Linked Questions
21 questions linked to/from Add Active Navigation Class Based on URL
0
votes
2
answers
315
views
I used jquery's toggleClass to add and remove but it's( <li> )list of <a> links [duplicate]
<ul class="nav">
<li>
<a href="/dashboard">
<i class="material-icons">dashboard</i>
<p>Dashboard</p>
</a>
...
1
vote
2
answers
7k
views
Setting active class when loading navbar through Jquery
I'm trying to use jquery to initialize the active class for a navigation menu when loading it as a separate html file.
I am not familiar with PHP and I'm pretty new to website generation, so I'm not ...
2
votes
2
answers
3k
views
Selecting the anchor tag of a particular href using jQuery
THE AIM
After refreshing the browser, I would like that the user stays in the menu/content they were before refreshing.
THE PROBLEM
After refreshing the browser, the content of the particular menu ...
0
votes
1
answer
3k
views
Add Active Navigation Class Based on Child Page URL
I have a basic side menu structure which is generated dynamically based on post topics. Using the code below I am able to individually highlight the active link as intended when viewing the individual ...
0
votes
1
answer
1k
views
links in bootstrap menu doesn't work
I'm trying make a navigation menu following the bootsrap API.
Here is what I have:
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="Home" role="tab" data-...
1
vote
1
answer
1k
views
Active menu item based on URL and ID
I want to have active menu items in my navigation based on URL and ID, not href. None of the available solutions (this one, this one , or this one) worked for me.
My Navigation looks like this
<nav ...
0
votes
3
answers
549
views
JQuery 3.3.1 --- addClass to <a>
I am new to JQuery and am trying to add an 'active' tag to a bootstrap class. Can anyone let me know if there is something wrong with my syntax in my .js file.
Here is my base.js file:
$(document)....
1
vote
1
answer
789
views
how to add class 'active' to nav item whose href is in the location.pathname
I'm trying to build on top of a Jekyll template to build a blog style site. I'm currently in the process of writing and styling the navigation, which is giving me a couple of problems. Using the ...
0
votes
2
answers
601
views
Dynamically add class based on page
I have a navagation list written with bootstrap css:
<ul class="nav navbar-nav navbar-right">
<li class=""><a href="index.html">Home</a></li>
<li class="">&...
0
votes
1
answer
589
views
How to make <li> remain highlighted when redirected to new page?
I'm trying to make call a navigation bar(navbar.html) in to my index.html. Navbar.html has its own css and inside navbar.html is a script that changes the class of <li> when <a> is pressed....
1
vote
2
answers
547
views
How to change the active class when clicking on other link?
There are 2 scenarios for this issue:
with using preventDefault()
Without using preventDefault()
I am changing the active class using jQuery.
What happens when I use preventDefault():
As you can see, ...
0
votes
1
answer
618
views
change active li and its active parent li when clicking on link
I want to make a menu, and change the class of parent li and child li when clicking.
When I click on the li with no class="active", I want jQuery to add a class on the empty li and its child li and ...
0
votes
1
answer
549
views
How do I add 'active' class to the clicked nav link in javascript?
I have a bootstrap navbar and I am trying to use javascript to change which nav link has the active click based on which navlink was clicked. The problem I am having is that when the user clicks a nav ...
1
vote
2
answers
297
views
Adding active class from bootstrap to li element
Hello i want to ask why my code doesn't work. I use ruby on rails with bootsrap and haml.
Here is my javascript code:
:javascript
$(".nav navbar-nav li a").click(function() {
$(this).parent()....
-1
votes
3
answers
450
views
Active is not working on link in css
I am working on a navigation bar Active color on my navigation bar is not working.Hover is working fine but not the active.In when from browser i select toogle element state and click on active ...