Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addOnStateToMenu() {
- var slugIndex = getSlugIndex();
- var menus = new Array('home','about-us','gsa-schedules', 'services', 'careers', 'case-studies','contact-us');
- var parent = (window.location.pathname).split('/')[slugIndex];
- $('#menuList li').each(function(index){
- if ( parent === menus[index])
- $(this).addClass('current-menu-parent');
- });
- }
- function getSlugIndex() {
- if (window.location.hostname.indexOf("localhost") != -1 ){
- return 2;
- }
- else{
- return 1;
- }
- }
Add Comment
Please, Sign In to add comment