第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

請(qǐng)問為什么沒有效果了??不知都哪里出錯(cuò)了。

<!DOCTYPE HTML>
<html>
<head>
?? ?<title>多物體動(dòng)畫</title>
?? ?<meta charset="UTF-8">
?? ?<style type="text/css">
?? ??? ?*{
?? ??? ??? ?padding: 0px;
?? ??? ??? ?margin: 0px;
?? ??? ?}
?? ??? ?ul{
?? ??? ??? ?list-style: none;
?? ??? ?}
?? ??? ?ul li{
?? ??? ??? ?width: 130px;
?? ??? ??? ?height: 100px;
?? ??? ??? ?background:#F33;
?? ??? ??? ?margin-top:15px;
?? ??? ?}
?? ?</style>
?? ?<script type="text/javascript">
?? ??? ?window.onload=function(){
?? ??? ?//事件監(jiān)聽
?? ??? ?var aLi = document.getElementsByTagName('li');?? ??? ??? ?
?? ??? ?for(var i=0;i<aLi.length;i++){?? ??? ??? ?
?? ??? ??? ?aLi[i].onmouseover = function (){
?? ??? ??? ??? ?move2(this,400);
?? ??? ??? ?}
?? ??? ??? ?aLi[i].onmouseout = function (){
?? ??? ??? ??? ?move2(this,130);
?? ??? ??? ?}
?? ??? ?? }?? ??? ?
?? ??? ?}
?? ??? ?//動(dòng)畫函數(shù)
?? ??? ?? //var timer=null;
?? ??? ?? function move2(obj,Target){
?? ??? ? ??? ?clearInterval(obj.timer);
?? ??? ? ??? ?obj.timer = setInterval(function(){
?? ??? ? ??? ?var speed = (Target-obj.offsetWidth)/8;
?? ??? ? ??? ??? ?speed = speed>0?Math.ceil(speed):Math.floor(speed);
?? ??? ? ??? ??? ?if(obj.offsetWidth==Target){
?? ??? ? ??? ??? ??? ?clearInterval(obj.timer);//運(yùn)動(dòng)到指定位置后清除計(jì)時(shí)器
?? ??? ? ??? ??? ?}else{
?? ??? ? ??? ??? ??? ?obj.style.width = obj.offsetWidth+speed+'px';
?? ??? ? ??? ??? ?},30);
?? ??? ?? }?? ??? ??? ??? ?
?? ?</script>
</head>
<body>
?? ?<ul>
?? ??? ?<li><a href="#"></a></li>
?? ??? ?<li><a href="#"></a></li>
?? ??? ?<li><a href="#"></a></li>
?? ?</ul>
</body>
</html>

正在回答

2 回答

<!DOCTYPE?HTML>
<html>
<head>
????<title>多物體動(dòng)畫</title>
????<meta?charset="UTF-8">
????<style?type="text/css">
????????*{
????????????padding:?0px;
????????????margin:?0px;
????????}
????????ul{
????????????list-style:?none;
????????}
????????ul?li{
????????????width:?130px;
????????????height:?100px;
????????????background:#F33;
????????????margin-top:15px;
????????}
????</style>
????<script?type="text/javascript">
????????window.onload=function(){
????????//事件監(jiān)聽
????????var?aLi?=?document.getElementsByTagName('li');
????????for(var?i=0;?i?<?aLi.length;?i++){????????????
????????????aLi[i].onmouseover?=?function?(){
????????????????move2(this,?400);
????????????}
????????????aLi[i].onmouseout?=?function?(){
????????????????move2(this,?130);
????????????}
??????????}????????
????????}
????????//動(dòng)畫函數(shù)
??????????//var?timer=null;
??????????function?move2(obj,Target){
??????????????clearInterval(obj.timer);
??????????????obj.timer?=?setInterval(function(){
??????????????????var?speed?=?(Target-obj.offsetWidth)/8;
??????????????????speed?=?speed?>?0???Math.ceil(speed)?:?Math.floor(speed);
??????????????????if(obj.offsetWidth==Target){
??????????????????????clearInterval(obj.timer);//運(yùn)動(dòng)到指定位置后清除計(jì)時(shí)器
??????????????????}else{
??????????????????????obj.style.width?=?obj.offsetWidth+speed+'px';
??????????????????}
??????????????},?30)
??????????}??????????????
????</script>
</head>
<body>
????<ul>
????????<li><a?href="#"></a></li>
????????<li><a?href="#"></a></li>
????????<li><a?href="#"></a></li>
????</ul>
</body>
</html>

setInterval的函數(shù)沒有寫正確。時(shí)間設(shè)置在else上面了

0 回復(fù) 有任何疑惑可以回復(fù)我~

看看錯(cuò)誤的提示位置,指示仔細(xì)檢查格式

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

請(qǐng)問為什么沒有效果了??不知都哪里出錯(cuò)了。

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)