JoshのSpace~~~~~

                                                                                                             剣は凶器、剣術は殺人術、どんな綺麗事やお題目を口にしてもそれが真実。
                                                                                                                                                                             -----緋村剣心

博客园 首页 新随笔 联系 订阅 管理

想用js代码实现多层的显隐,当鼠标移到相应链接的相应层即显示,其他层隐藏
js代码如下:

 1<SCRIPT language=javascript>
 2          function hidesubmenu(sid)
 3          {
 4        eval("submenu" + sid + ".style.display=\"none\";");
 5           }

 6          function showsubmenu(sid)
 7          {
 8            submenu1.style.display="none";
 9            submenu2.style.display="none";
10            submenu3.style.display="none";
11             eval("submenu" + sid + ".style.display=\"block\";");
12            //eval("document.submenu" + sid + ".visibility=\"visible\";");
13            }

14</SCRIPT>

html中对应代码如下:

 1<span class="bold12"><title="国内新闻" href="###" onmouseover="javascript:showsubmenu('1');">国内要闻</a></span>
 2    <span class="bold12"><title="财经新闻" href="###" onmouseover="javascript:showsubmenu('2');">财经新闻</a></span>
 3    <span class="bold12"><title="体育新闻" href="###" onmouseover="javascript:showsubmenu('3');">体育新闻</a></span>
 4
 5  <div id="submenu1" style="BORDER:1px dotted;DISPLAY: none; background:#ffffff;height:270px"  ><script language="JavaScript1.1" src="http://paidip.china.com/freecode/out.php?typeid=945&num=10&t=2&f=12&c=000088&l=1"></script></div>
 6     <div id="submenu2" style="BORDER:1px dotted;DISPLAY: none;background:#ffffff;height:270px"  ><script language="JavaScript1.1" src="http://paidip.china.com/freecode/out.php?typeid=11009723&num=10&t=2&f=12&c=000088&l=1"></script></div>
 7     <div id="submenu3" style="BORDER:1px dotted;background:#ffffff;DISPLAY: none;height:270px" ><script language="JavaScript1.1" src="http://paidip.china.com/freecode/out.php?typeid=10002913&num=10&t=2&f=12&c=FF0000&l=1"></script></div>
 8   <div id="submenu4" style="BORDER:1px dotted; DISPLAY: none;background:#ffffff;height:270px"  ><script language="JavaScript1.1" src="http://paidip.china.com/freecode/out.php?typeid=444&num=10&t=2&f=12&c=000088&l=1"></script></div>
 9     <div id="submenu5" style="BORDER:1px dotted;DISPLAY: none;background:#ffffff;height:270px"  ><script language="JavaScript1.1" src="http://paidip.china.com/freecode/out.php?typeid=205&num=10&t=2&f=12&c=000088&l=1"></script></div>
10     <div id="submenu6" style="BORDER:1px dotted;background:#ffffff;DISPLAY: none;height:270px"  ><script language="JavaScript1.1" src="http://paidip.china.com/freecode/out.php?typeid=1007&num=10&t=2&f=12&c=000088&l=1"></script></div>
11   <div id="submenu7" style="BORDER:1px dotted;background:#ffffff;height:270px"  ><script language="JavaScript1.1" src="http://paidip.china.com/freecode/out.php?typeid=154&num=10&t=2&f=12&c=000088&l=1"></script></div>

 

posted on 2006-04-21 10:46  Josh  阅读(2410)  评论(0编辑  收藏  举报