zoukankan      html  css  js  c++  java
  • js代码实现多层的显隐,当鼠标移到相应链接的相应层即显示,其他层隐藏(转)

    想用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>
  • 相关阅读:
    后向边
    图的割点、桥和双连通分支的基本概念
    Hihocoder 1062 最近公共祖先1
    会场问题 差分解法
    POJ2976 01分数规划 普通题
    Hihocoder 1049
    hihocoder 1050树中最长路
    Hihocoder 1055
    POJ1463
    C语言|博课作业02
  • 原文地址:https://www.cnblogs.com/josh/p/381016.html
Copyright © 2011-2022 走看看