-
-
Save anonymous/8a6f7889f88a72c5225d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var is_mobile = false, | |
page = document.location.pathname.match(/[^\/]+$/)[0]; | |
$(document).ready(function(){ | |
var ul = $('nav > ul'), | |
li = ul.children('li'), | |
href = li.find('a[href*="'+page+'"]'), | |
is404 = true; | |
if($('#mobile').css('display')=='none') { | |
is_mobile = true; | |
} | |
//alert(li.children('a').attr('href')); | |
if(is_mobile) { | |
$(li.find('a[href*="contact.php"]')).removeAttr('style'); | |
//jQuery.makeArray(li.children('a').attr('href')); | |
//move element to top | |
ul.prepend(href.parent()); | |
if(page != ""){ | |
li.children('a').each(function(){ | |
if (page == this.attr('href')) { | |
is404 = false; | |
} | |
}); | |
if (is404) { | |
ul.prepend("<li><a href='404NotFound.php'><icon><img src='images/home-icon.png'></icon>404</a></li>"); | |
} | |
} | |
prepareList(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment