js点击激活class


jq插件



<script src="jq.js"></script>



<div class="nav-wdw">

<a href="/">首页</a>

<a href="">产品中心</a>

<a href="">新闻动态</a>
</div>




<script type="text/javascript">

$(document).ready(function () {

$('.nav-wdw a').each(function () {

if ($($(this))[0].href == String(window.location))

$(this).addClass('active').attr('href', 'javascript:void(0);');

});

})
</script>


微信扫码咨询
建站咨询
cache
Processed in 0.006589 Second.