求助!JS+css写的滑动门的直接访问问题
最近遇到一个关于滑动门的直接访问问题,想请教一下各位高手
具体问题如下,我有一个滑动门,我想通过网址直接访问其中某个滑动门,例如下面这个滑动门代码有7个不同的门,我想用网址直接访问第四个,因为这个滑动门的页面打开是直接默认显示第一个滑动门项的内容的,(我想通过网址后面直接加一个什么参数或者js代码),不知道该怎么做,是个菜鸟,请勿笑^_^ !html代码和js代码如下:
如这个代码无法实现直接用网址访问其中的某个门,各位有能直接访问的也请赐予一个,拜谢了!!
html:
<div id="TabSynCon1"> <!--1-->
<div class="price_title">
<div class="price_lj_list">
<ul>
<li class="pld" onmouseover="setTabSyn(1);">滑动1</li>
<li class="pld2" onmouseover="setTabSyn(2);">滑动2</li>
<li class="pld2" onmouseover="setTabSyn(3);">滑动3</li>
<li class="pld2" onmouseover="setTabSyn(4);">滑动4</li>
<li class="pld2" onmouseover="setTabSyn(5);">滑动5</li>
<li class="pld2" onmouseover="setTabSyn(6);">滑动6</li>
<li class="pld2" onmouseover="setTabSyn(7);">滑动7</li>
</ul>
</div>
</div>
<div class="price_con">
内容部分
</div>
</div><!--1-->
<div id="TabSynCon2" style="display:none"> <!--2-->
<div class="price_title">
<div class="price_lj_list">
<ul>
<li class="pld2" onmouseover="setTabSyn(1);">滑动1</li>
<li class="pld" onmouseover="setTabSyn(2);">滑动2</li>
<li class="pld2" onmouseover="setTabSyn(3);">滑动3</li>
<li class="pld2" onmouseover="setTabSyn(4);">滑动4</li>
<li class="pld2" onmouseover="setTabSyn(5);">滑动5</li>
<li class="pld2" onmouseover="setTabSyn(6);">滑动6</li>
<li class="pld2" onmouseover="setTabSyn(7);">滑动7</li>
</ul>
</div>
</div>
<div class="price_con">
内容部分
</div>
</div><!--2-->
<div id="TabSynCon3" style="display:none"> <!--3-->
<div class="price_title">
<div class="price_lj_list">
<ul>
<li class="pld2" onmouseover="setTabSyn(1);">滑动1</li>
<li class="pld2" onmouseover="setTabSyn(2);">滑动2</li>
<li class="pld" onmouseover="setTabSyn(3);">滑动3</li>
<li class="pld2" onmouseover="setTabSyn(4);">滑动4</li>
<li class="pld2" onmouseover="setTabSyn(5);">滑动5</li>
<li class="pld2" onmouseover="setTabSyn(6);">滑动6</li>
<li class="pld2" onmouseover="setTabSyn(7);">滑动7</li>
</ul>
</div>
</div>
<div class="price_con">
内容部分
</div>
</div><!--3-->
<div id="TabSynCon4" style="display:none"> <!--4-->
<div class="price_title">
<div class="price_lj_list">
<ul>
<li class="pld2" onmouseover="setTabSyn(1);">滑动1</li>
<li class="pld2" onmouseover="setTabSyn(2);">滑动2</li>
<li class="pld2" onmouseover="setTabSyn(3);">滑动3</li>
<li class="pld" onmouseover="setTabSyn(4);">滑动4</li>
<li class="pld2" onmouseover="setTabSyn(5);">滑动5</li>
<li class="pld2" onmouseover="setTabSyn(6);">滑动6</li>
<li class="pld2" onmouseover="setTabSyn(7);">滑动7</li>
</ul>
</div>
</div>
<div class="price_con">
内容部分
</div>
</div><!--4-->
<div id="TabSynCon5" style="display:none"> <!--5-->
<div class="price_title">
<div class="price_lj_list">
<ul>
<li class="pld2" onmouseover="setTabSyn(1);">滑动1</li>
<li class="pld2" onmouseover="setTabSyn(2);">滑动2</li>
<li class="pld2" onmouseover="setTabSyn(3);">滑动3</li>
<li class="pld2" onmouseover="setTabSyn(4);">滑动4</li>
<li class="pld" onmouseover="setTabSyn(5);">滑动5</li>
<li class="pld2" onmouseover="setTabSyn(6);">滑动6</li>
<li class="pld2" onmouseover="setTabSyn(7);">滑动7</li>
</ul>
</div>
</div>
<div class="price_con">
内容部分
</div>
</div><!--5-->
<div id="TabSynCon6" style="display:none"> <!--6-->
<div class="price_title">
<div class="price_lj_list">
<ul>
<li class="pld2" onmouseover="setTabSyn(1);">滑动1</li>
<li class="pld2" onmouseover="setTabSyn(2);">滑动2</li>
<li class="pld2" onmouseover="setTabSyn(3);">滑动3</li>
<li class="pld2" onmouseover="setTabSyn(4);">滑动4</li>
<li class="pld2" onmouseover="setTabSyn(5);">滑动5</li>
<li class="pld" onmouseover="setTabSyn(6);">滑动6</li>
<li class="pld2" onmouseover="setTabSyn(7);">滑动7</li>
</ul>
</div>
</div>
<div class="price_con">
内容部分
</div>
</div><!--6-->
<div id="TabSynCon7" style="display:none"> <!--7-->
<div class="price_title">
<div class="price_lj_list">
<ul>
<li class="pld2" onmouseover="setTabSyn(1);">滑动1</li>
<li class="pld2" onmouseover="setTabSyn(2);">滑动2</li>
<li class="pld2" onmouseover="setTabSyn(3);">滑动3</li>
<li class="pld2" onmouseover="setTabSyn(4);">滑动4</li>
<li class="pld2" onmouseover="setTabSyn(5);">滑动5</li>
<li class="pld2" onmouseover="setTabSyn(6);">滑动6</li>
<li class="pld" onmouseover="setTabSyn(7);">滑动7</li>
</ul>
</div>
</div>
<div class="price_con">
内容部分
</div>
</div><!--7-->
[解决办法]
给你个例子,你输入参数display=1 和 不输入或者输入其他 看看是不是你想要的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>test</title><script language="javascript" type="text/javascript">//js获取参数的函数var getQueryString = function (name) { var reg = new RegExp("(^|&)" + name.toLocaleLowerCase() + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).toLocaleLowerCase().match(reg); if (r != null) { return unescape(r[2]); } return null;};var setStyle = function () { var param = getQueryString("display"); if(param === "1") { document.getElementById("myId").style.display = "block"; } else { document.getElementById("myId").style.display = "none"; }};window.onload = setStyle;</script><style type="text/css"></style></head><body><div id="myId">看我显示没有?</div></body></html>