为了账号安全,请及时绑定邮箱和手机立即绑定

为什么没有鼠标移入效果

为什么没有鼠标移入效果

qq_流年_22 2016-06-07 11:30:05
<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <title>Title</title>     <style>         #box{             background: whitesmoke;width: 300px; height: 32px;overflow: hidden;         }         #con1,#con2{margin: 0;padding: 0}         li{list-style: none;}         a{text-decoration: none;color: #666;}         a:hover{color: red;}     </style>     <script>         window.onload=function(){             var box=document.getElementById('box');             var con1=document.getElementById('con1');             var con2=document.getElementById('con2');             var time=50;             box.scrollTop=0;             con2.innerHTML=con1.innerHTML;             function fnTop(){                 if(box.scrollTop>=con1.scrollHeight){                     box.scrollTop=0;                 }else {                     box.scrollTop++;                 }             }             var Oup= setInterval(fnTop,time);             box.onmouseover = function(){                 clearInterval(Oup);             }             box.onmouseout = function(){                 var Oup= setInterval(fnTop,time);             }         }     </script> </head> <body>         <div id="box">             <ul id="con1">                 <a href="#"><li>1.longjuanfeng</li></a>                 <a href="#"><li>2.jiandanai</li></a>                 <a href="#"><li>3.xingqing</li></a>                 <a href="#"><li>4.aizaixiyuanqian</li></a>                 <a href="#"><li>5.keainvren</li></a>                 <a href="#"><li>6.huidaoguoqu</li></a>             </ul>             <ul id="con2"></ul>         </div> </body> </html>
查看完整描述

2 回答

?
solitary2015

TA贡献2条经验 获得超1个赞

第37行去掉var,还有35行是不是少一个分号啊?<a href="#"><li>6.huidaoguoqu</li></a>最好写成<li><a href="#">6.huidaoguoqu</a></li>

查看完整回答
1 反对 回复 2016-06-07
  • 2 回答
  • 0 关注
  • 1447 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信