亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

各位大神幫看看哪里有問題,找半天找不見!鼠標觸碰滑塊滑出

各位大神幫看看哪里有問題,找半天找不見!鼠標觸碰滑塊滑出

名字只是個代號丶 2016-08-02 19:25:45
<!doctype?html> <html> ?<head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"> ??<title>滑出導航欄</title> ??<style> body,div,span{ ????margin:?0; ????padding:?0; } #div1{ ????width:?200px; ????height:?200px; ????background:?red; ????position:?relative; ????left:-200px; ????top:200px; } #div1?span{ ????????width:?20px; ????????height:?50px; ????????background:?blue; ????????position:?absolute; ????????left:?200px; ????????top:75px; ????} ??</style> ? ??<script> ????window.onload=function(){ ????????var?v=document.getELementById("div1"); ????????v.onmouseover=function(){ ????????????star(); ????????v.onmouseout=function(){ ????????????star1(); ????????}???? ????????} ????} ????????var?timer=null; ????function?star(){ ????????clearInterval(timer); ????????var?v=document.getELementById("div1"); ????????timer=setInterval(function(){ ????????????if(v.offsetLeft==0){ ????????????????clearInterval(timer); ????????????} ????????????else{ ????????????????v.style.left=v.offsetLeft+10+"px"; ????????????} ????????},30) ????} ????function?star1(){ ????????clearInterval(timer); ????????var?v=document.getELementById("div1"); ????????timer=setInterval(function(){ ????????????if(v.offsetLeft==-200){ ????????????????clearInterval(timer); ????????????} ????????????else{ ????????????????v.style.left=v.offsetLeft-10+"px"; ????????????} ????????},30) ????} </script>?? ??<body> <div?id="div1"> <span?id="share">分享</span> </div> ??</body> ??</html>
查看完整描述

1 回答

已采納
?
回夢

TA貢獻18條經驗 獲得超5個贊

取ID寫錯了。getElementById.你的E后面的L你大寫了。

查看完整回答
反對 回復 2016-08-02
  • 1 回答
  • 0 關注
  • 1294 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號