[JavaScript] [jQuery] 滑动门 →→→→→进入此内容的聊天室

来自 , 2020-07-29, 写在 JavaScript, 查看 107 次.
URL http://www.code666.cn/view/e9de722f
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  5. <title>jQuery 滑动门</title>
  6. <script type="text/javascript" src="/ajaxjs/jquery1.3.2.js"></script>
  7. <script type="text/javascript">
  8.    $(function(){
  9.   var len=$(".ul1 li").length;
  10.   var index;
  11.   var time;
  12.     $(".ul1 li").mousemove(function(){
  13.             index=$(".ul1 li").index(this);
  14.            show(index);
  15.            }).eq(0).mousemove();
  16.            $(".ul2").hover(function(){
  17.                 clearInterval(time);
  18.                  },function(){
  19.                   time=setInterval(function(){
  20.                     show(index)
  21.                         index++;
  22.                         if(index==len){index=0;}
  23.                         },2000);
  24.                         }).trigger("mouseleave");
  25. })
  26. function show(index) {
  27.   $(".ul2 li").eq(index).show().siblings().hide();
  28.   $(".ul1 li").css("background","url(/jscss/demoimg/201006/aa.gif)").eq(index).css("background","url(/jscss/demoimg/201006/bb.gif)");
  29. }
  30.  
  31. </script>
  32. <style type="text/css">
  33. body{ font-family:"宋体"; font-size:9pt; color:#ffffff}
  34.   #container{ width:510px; height:200px; border:4px #1025c0 solid; margin:0 auto}
  35.   #container ul li{ cursor:pointer}
  36.   #container .top{ border:none}
  37.   #container .top ul{ margin:0; padding:0}
  38.   #container .top ul li{ cursor:pointer;float:left;list-style:none; width:100px; height:40px; line-height:40px; text-align:center; background:url(/jscss/demoimg/201006/aa.gif) repeat-x; border:1px black solid}
  39.   #container .bottom{ width:510px; height:160px; color:#000000; border:none;}
  40.   #container .bottom ul{ margin:0; padding:0; width:510px; height:160px;}
  41.   #container .bottom ul li{ list-style:none}
  42.   .hide{ display:none}
  43. </style>
  44. </head>
  45.  
  46. <body>
  47. <div id="container">
  48. <div class="top">
  49. <ul class="ul1">
  50. <li>第一栏</li><li>第二栏</li><li>第三栏</li><li>第四栏</li><li>第五栏</li>
  51. </ul>
  52. </div>
  53. <div class="bottom">
  54. <ul class="ul2">
  55. <li>第一栏第一栏第一栏第一栏第一栏</li><li class="hide">第二栏第二栏第二栏第二栏</li><li class="hide">第三栏第三栏第三栏第三栏</li><li class="hide">第四栏第四栏第四栏第四栏</li><li class="hide">第五栏第五栏第五栏第五栏</li>
  56. </ul>
  57. </div>
  58. </div>
  59. </body>
  60. </html>
  61. //javascript/1088

回复 "[jQuery] 滑动门"

这儿你可以回复上面这条便签

captcha