0
我想显示在页面加载和URL 要么test.cfm?csedept_id = 17,18如何根据href加载页面时显示div?
现在它被正确加载和highlings的“礼”它属于但是 它不显示加载新网址时的'ul'。
http://jsfiddle.net/zund0ycj/2/
<div id="nav_main">
<ul id="accordion" class="collapsible ">
<li class="emptyChild"> <a id="all" href="phonelistsearch_test.cfm?all" onclick="changeClass('all')" >All</a></li>
<li class="fullChild"><a id="corporate" href="phonelistsearch_test.cfm?corporate" onclick="changeClass('corporate')" >Corporate</a>  <a class="opener"></a>
<ul>
<cfloop query="GetDeptNum_corporate">
<cfoutput>
<div class="content">
<li> <a href="test.cfm?csedept_id=17">#csedept_name#</a> </li>
<li> <a href="test.cfm?csedept_id=18">#csedept_name#</a> </li>
</div>
</cfoutput>
</cfloop>
</ul>
</li>
</div>
var url = "test.cfm?csedept_id=17,18";
$(function(){
console.log(url);
if (location.href==url){
$('.content').show();
}
});
这似乎不若HREF =工作“phonelistsearch_test.cfm?企业” – jfishbow 2014-11-21 22:08:21
OKI,检查我的编辑 – 2014-11-21 22:35:32