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

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么結果沒出來,都沒有反應

<!DOCTYPE html>
<html>
<head>
?? ?<meta charset="UTF-8">
?? ?<title>JS動畫2</title>
<style type="text/css">
*{margin: 0;
?padding: 0;
?}
#share{
?? ?width: 200px;
?? ?height: 200px;
?? ?background-color:#11FA45 ;
??? position: relative;
??? left: -200px;
}
#share span{
?? ?width: 60px;
?? ?height: 50px;
?? ?line-height: 50px;
?? ?background-color: #F36812;
?? ?position: absolute;
??? text-align: center;
??? top:100px;
??? right: -60px;
}
</style>
</head>
<body>
?? ?<div id="share">
??????? <span>分享</span>
??? </div>


<script type="text/javascript">
?? ?window.onload=function(){
?? ?var move=document.getElementById("share");
?? ?move.onmouseover=function(){
?? ??? ?startmove();
?? ?}
}
?var timer=null;
function startmove(){
?? ?clearInterval(timer);
?? ?var move=document.getElementById("share");
?? ?timer=setInterval(function(){
?? ??? ?if (move.offsetLeft>=0) {
?? ??? ? ?? ?clearInterval(timer);
?? ??? ? } else{
?? ??? ??? ?move.style.left=move.offsetLeft+10+'px';}
?? ??? ? },30)
?? ??? ?}
?? ??? ?
</body>
</script>
</html>

正在回答

4 回答

</body>
</script>這塊寫錯了,應該是

</script>

</body>

0 回復 有任何疑惑可以回復我~
#1

周木杉 提問者

改過來了還是沒有反應
2015-12-16 回復 有任何疑惑可以回復我~
#2

周木杉 提問者

非常感謝!
2015-12-16 回復 有任何疑惑可以回復我~

將</body>和</script>兩個標簽互換就可以了


0 回復 有任何疑惑可以回復我~

<!DOCTYPE html>
<html>
<head>
??? <meta charset="UTF-8">
??? <title>JS動畫2</title>
<style type="text/css">
*{margin: 0;
?padding: 0;
?}
#share{
??? width: 200px;
??? height: 200px;
??? background-color:#11FA45 ;
??? position: relative;
??? left: -200px;
}
#share span{
??? width: 60px;
??? height: 50px;
??? line-height: 50px;
??? background-color: #F36812;
??? position: absolute;
??? text-align: center;
??? top:100px;
??? right: -60px;
}
</style>
</head>
<body>
??? <div id="share">
??????? <span>分享</span>
??? </div>


<script type="text/javascript">
??? window.onload=function(){
??? var move=document.getElementById("share");
??? move.onmouseover=function(){
??????? startmove();
??? }
?? ?move.onmouseout=function(){
??????? startmout();
??? }
}
?var timer=null;
function startmove(){
??? clearInterval(timer);
??? var move=document.getElementById("share");
??? timer=setInterval(function(){
??????? if (move.offsetLeft>=0) {
???????????? clearInterval(timer);
???????? } else{
??????????? move.style.left=move.offsetLeft+10+'px';}
???????? },30)
??????? }
?</script>????? ?
</body>

</html>

0 回復 有任何疑惑可以回復我~

你的body的問題,把結束標簽提出去

<body>
<div?id="share">
???<span>分享</span>
</div>

</body>

<script?type="text/javascript">
???window.onload=function(){
??????var?move=document.getElementById("share");
??????move.onmouseover=function(){
?????????startmove();
??????}
???}
???var?timer=null;
???function?startmove(){
??????clearInterval(timer);
??????var?move=document.getElementById("share");
??????timer=setInterval(function(){
?????????if?(move.offsetLeft>=0)?{
????????????clearInterval(timer);
?????????}?else{
????????????move.style.left=move.offsetLeft+10+'px';}
??????},30)
???}
</script>


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么結果沒出來,都沒有反應

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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