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

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

如何將更改透明度和變換高度同時(shí)作用在\多物體運(yùn)動\上,求各位大神幫幫忙,看我哪里錯(cuò)了

57e73ffd0001292505000161.jpg

57e73ffd00013b2905000079.jpg

57e73ffe0001777505000282.jpg

請問JS部分應(yīng)該怎么改?

正在回答

4 回答

<!doctype html>
<html>
?<head>
? <meta charset="UTF-8">
? <meta name="Generator" content="EditPlus?">
? <meta name="Author" content="">
? <meta name="Keywords" content="">
? <meta name="Description" content="">
? <title>Document</title>
? <style type="text/css">
?? ? * {
?? ??? ?margin:0;
?? ??? ?padding:0;
?? ?}
?? ? ul li{
?? ??? ?width:200px;
?? ??? ?height:100px;
?? ??? ?background:yellow;
?? ??? ?list-style:none;
?? ??? ?margin-top:20px;
?? ??? ?filter:alpha(opacity:30);
?? ??? ?opacity:0.3;
?? ?}
? </style>
? <script type="text/javascript">
?? ?window.onload=function(){
?? ??? ?var lis=document.getElementsByTagName("li");
?? ??? ?//var timer=null;
?? ??? ?for(var i=0;i<lis.length;i++){
?? ??? ??? ?lis[i].alpha=30;
?? ??? ??? ?lis[i].timer=null;
?? ??? ??? ?lis[i].onmouseover=function(){
?? ??? ??? ??? ?showMove(this,400,100);
?? ??? ??? ?}
?? ??? ??? ?lis[i].onmouseout=function(){
?? ??? ??? ??? ?showMove(this,200,30);
?? ??? ??? ?}
?? ??? ?}
?? ??? ?function showMove(obj,target1,target2){
?? ??? ??? ?clearInterval(obj.timer);
?? ??? ??? ?obj.timer=setInterval(function(){
?? ??? ??? ??? ?var sheed=(target1-obj.offsetWidth)/10;
?? ??? ??? ??? ?if(sheed>0){
?? ??? ??? ??? ??? ?sheed=Math.ceil(sheed);
?? ??? ??? ??? ?}else {
?? ??? ??? ??? ??? ?sheed=Math.floor(sheed);
?? ??? ??? ??? ?}
?? ??? ??? ??? ?var sheed2=0;
?? ??? ??? ??? ?if(obj.alpha>target2){
?? ??? ??? ??? ??? ?sheed2=-5;
?? ??? ??? ??? ?}else{
?? ??? ??? ??? ??? ?sheed2=5
?? ??? ??? ??? ?}
?? ??? ??? ??? ?if(obj.alpha == target2 && target1 == obj.offsetWidth){
?? ??? ??? ??? ??? ?clearInterval(obj.timer);
?? ??? ??? ??? ?}else{
?? ??? ??? ??? ??? ?obj.alpha+=sheed2;
?? ??? ??? ??? ??? ?obj.style.filter="alpha(opacity:"+obj.alpha+")";
?? ??? ??? ??? ??? ?obj.style.opacity=obj.alpha/100;
?? ??? ??? ??? ??? ?obj.style.width=obj.offsetWidth+sheed+"px";
?? ??? ??? ??? ?}
?? ??? ??? ?},30)
?? ??? ?}
?? ?}
? </script>
?</head>
?<body>
? <ul>
?? ?<li></li>
?? ?<li></li>
?? ?<li></li>
? </ul>
?</body>
</html>

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

最后一句,obj.style.opacity=obj.alpha/10改為obj.style.opacity=obj.alpha/100,試試.我的代碼與你的結(jié)構(gòu)類似,兩種效果都出來了

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

你的obj.alpha沒有定義


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

沒看懂你透明度是怎么個(gè)變化的!1

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

舉報(bào)

0/150
提交
取消

如何將更改透明度和變換高度同時(shí)作用在\多物體運(yùn)動\上,求各位大神幫幫忙,看我哪里錯(cuò)了

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

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

幫助反饋 APP下載

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

公眾號

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