You can use jQuery to loop through all links and compare their URLs with location
. Here is an example:
$(".sf-menu a").filter(function(){
return this.href == location.href.replace(/#.*/, "");
}).addClass("active");
More Related Contents:
- Multiple javascript/css files: best practices?
- How to show ajax loading gif animation while the page is loading?
- Scrollable PHP Table [closed]
- How to hide css and js version details from weppalyzer in PHP
- I want to use jquery nested sortable plugin with drag and drop in codeigniter using mysqli
- how to make css work with php? [closed]
- How and where to put Jquery into a fully PHP page?
- How to insert database rows if there are no answers
- What is the correct way to apply css on php echo?
- Download the text over image using jquery
- Prevent duplicate submission with post in jquery [closed]
- unwanted (text) after using include
- How do I close a connection early?
- How to access PHP variables in JavaScript or jQuery rather than [duplicate]
- Update data on a page without refreshing
- Passing JavaScript array to PHP through jQuery $.ajax
- jQuery UI Sortable, then write order into a database
- jQuery – Call ajax every 10 seconds
- Creating jQuery AJAX requests to a PHP function
- Preventing Caching of CSS Files
- Redirect with PHP after ajax call
- jquery using ajax to send data and save in php [duplicate]
- Sending multiple data parameters with jQuery AJAX
- Refresh a table with jQuery/Ajax every 5 seconds
- How to make a Cascading Drop Down List in PHP using jQuery
- How to add anchor tag to a URL from text input
- AJAX only access
- PHP + Ajax Login
- show progressbar while loading pages using jquery ajax in single page website
- Include: CSS with .php file extension?