Nonsense not much said, directly to everyone to paste the code.
<script> $ (function () {//highlight current/active link left navigation determines the current active navigation $ (' Ul.main-menu li a '). each (function () {V Ar wo = window.location.href.substring (window.location.href.lastIndexOf ('/') + 1, window.location.href.lastIndexOf ('
.')); if ($ (this). attr (' href ') = = (Wo + ". html")) {$ (this). Parent (). addclass (' active '), $ (this). Parents (). addclass (' active '
);
$ (this). Parents (' Li '). Find ("I:first"). Toggleclass ("Glyphicon-minus");
$ (this). Parents (' ul '). Slidedown (); }else if ("dxs" = Wo | | "Syd" = Wo) && ($ (this). attr (' href ') = = "Dbs.html")) {$ (this). Parent (). addclass (' active '), $ (this). Parents ().
AddClass (' active ');
$ (this). Parents (' Li '). Find ("I:first"). Toggleclass ("Glyphicon-minus");
$ (this). Parents (' ul '). Slidedown ();
}
}); /*** Begin homepage Left menu */$ (". Main-menu a"). Click (function () {//Set current Li to active $ (this). Find ("I:first"). Toggleclass ("
Glyphicon-minus ");
}); $ (". Main-menu a"). Click (function () {//replace plus minus sign icon $ (this) for other navigation. Parent (' Li '). Siblings (". Active"). Find ("I:first"). Toggleclass ("Glyphicon-minus ");
Alert ($ (this). index ());
Remove the other navigation's click Style and collapse $ (this). Parent (' Li '). Siblings (". Active"). Removeclass ("active"). Children ("ul"). Slideup (' fast ');
$ (this). Next (' ul '). Slidetoggle (' fast ');
$ (this). Parent (' Li '). addclass (' active ');
}); /************** End Homepage Left menu */}) </script>
The above is a small set to introduce JavaScript navigation script to judge the current navigation, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!