求帮我看看,为什么点击跳转到另外的页面导航栏样式没有改变_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 08:58:41
Original
1740 people have browsed it

$(document).ready(function(){	$("#memu a").each(function(){	  $this= $(this);	  if($this[0].href==String(window.location)){		  $this.addClass("active");	  }  });	});
Copy after login

<div class="header_list"><ul id="memu"><li  class="active"><a href="#page1">首页</a></li><li><a href="#page2">产品</a></li><li><a href="#page3">服务</a></li><li><a href="#page4">案例</a></li><li><a href="contact.html">联系我们</a></li></ul></div>
Copy after login


回复讨论(解决方案)

$this.parent().addClass("active");

$this.parent().addClass("active");

还是不行啊

调试找原因

刷新下页面。

调试找原因

已解决,谢谢
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!