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

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

我的json為什么沒作用

我的json為什么沒作用

健C 2016-07-29 20:12:50
我想用json來同時動畫的運動,但是為什么不行?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標題文檔</title></head><style type="text/css">*{margin:0;padding:0}ul li{list-style:none}ul li{margin-bottom:20px;background:#06F;height:100px;width:100px;filter:alpha(opacity:60);opacity:0.6;border:2px solid #CCC}</style><script type="text/javascript">window.onload=function(){ var ul=document.getElementsByTagName('ul')[0]; var li=ul.getElementsByTagName('li'); for(i=0;i<li.length;i++){ li[i].timer=null; li[i].onmouseover=function(){ var This=this; startfun(this,{width:200,opacity:100}/*,function(){ startfun(This,100,'opacity'); }*/); } li[i].onmouseout=function(){ var This=this; startfun(this,{width:100,opacity:60}/*,function(){ startfun(This,100,'width'); }*/); } } var alpha=60; function startfun(obj,json){ for(var arrt in json){? clearInterval(obj.timer); obj.timer=setInterval(function(){ if(arrt=='opacity'){ var icu=Math.round(parseFloat(getstyle(obj,arrt))*100); } else{ var icu=parseInt(getstyle(obj,arrt)); ? ?} var speed=(json[arrt]-icu)/10; speed=speed>0?Math.ceil(speed):Math.floor(speed); if(json[arrt]==icu){ clearInterval(obj.timer); /*if(fun){ fun(); }*/ } else{ if(arrt=='opacity') { obj.style.filter='alpha(opacity:'+(icu+speed)+')'; obj.style.opacity=(icu+speed)/100 } else{ obj.style.width=icu+speed+"px"; } ? ? ? ? } },30) } }}? ? function getstyle(obj,arrt){ if(obj.currentStlye){ return obj.currentStyle[arrt]; } else{ return getComputedStyle(obj,false)[arrt]; } }</script><body><ul> <li></li>? ? <li></li>? ? <li></li>? ? <li></li></ul></body></html>
查看完整描述

2 回答

?
杭州程序員張張

TA貢獻33條經驗 獲得超25個贊

無語,代碼都不格式化...!

查看完整回答
反對 回復 2016-07-29
  • 健C
    健C
    剛剛初學沒經驗..不懂如何格式化
  • 健C
    健C
    不是我沒格式化代碼..是把代碼復制粘貼上來之后縮進沒了..
  • 2 回答
  • 0 關注
  • 2234 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

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

公眾號

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