Expressjs Add Class To Li Element In Partial
I have this menu in a partial:
- Profile
-
$(function() { // put the possible page titles here // they must be in the url also var possible_pages = ['profile', 'test'], path = window.location.pathname, pattern, page, i, len; for (i = 0, len = possible_pages.length; i <= len; i++) { page = possible_pages[i]; pattern = new RegExp(page); if (pattern.test(path)) { $('.submenu .' + page).addClass('selected'); break; } } });
You may like these posts
- While Checking Checkbox Value Is Increasing Or Decreasing But It Works For Only One Check Box, In Should Work For Every Checkbox( Plain Javascripr)
- Get Only New "child Added" After Page Load
- How To Dynamically Load Content From An External Url, Inside Of A Jquery Ui Modal Dialog Widget?
- Javascript Compression
Post a Comment for "Expressjs Add Class To Li Element In Partial"