Fix flicker issue in top nav on loading and make use of generic class to hide and show nav