Wednesday, August 28, 2013

how add reomve active class using jquery go to other page

<script type="text/javascript">
$(document).ready(function(){
var str=location.href.toLowerCase();

$(".main_nav li a").each(function() {
alert('lopp');
     if (str.indexOf(this.href.toLowerCase()) > -1) {
         $("li.active").removeClass("active");
        $(this).parent().addClass("active");
     }
 });
 });
</script>

No comments:

Post a Comment