JQuery实现页面刷新后菜单保留鼠标点击addclass的样式
使用Jquery
$(function () { $("#divLefMenu li a").each(function () { if ($($(this))[0].href == String(window.location)) $(this).parent().addClass('hover'); }); });
版权声明:本文为博主原创文章,未经博主允许不得转载。
使用Jquery
$(function () { $("#divLefMenu li a").each(function () { if ($($(this))[0].href == String(window.location)) $(this).parent().addClass('hover'); }); });
版权声明:本文为博主原创文章,未经博主允许不得转载。