Shruthi Sathyanarayana
Shruthi Sathyanarayana

Reputation: 211

Navigation bar can be hidden, cannot make visible afterwards

I have a requirement where I need to hide my navbar toggle only in the login page. I am hiding it with js by using $('.navbar-toggle').addClass('hidden-xs');. Afterwards, I am making it visible once the login is successful by using $('.navbar-toggle').addClass('visible-xs');. However, when I login the navbar is still hidden. The intended behavior is for it to show back up.

Here is my loginController.js:

Once I login and inspect my navbar, it is using both hidden-xs and visible-xs. I want only visible-xs to work here. I don't know what went wrong.

Please help me.

Upvotes: 3

Views: 128

Answers (1)

mech
mech

Reputation: 2913

Try removing the 'hidden-xs' class first.

$('.navbar-toggle').removeClass('hidden-xs');
$('.navbar-toggle').addClass('visible-xs');

Upvotes: 2

Related Questions