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

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

WBOY
WBOYOriginal
2016-06-21 08:58:411741browse

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

<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>


回复讨论(解决方案)

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

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

还是不行啊

调试找原因

刷新下页面。

调试找原因

已解决,谢谢
Statement:
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