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

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

為啥我的鼠標(biāo)移出來的效果不顯示。。。。。

window.onload = function(){

var box = document.getElementById('box') ;?

box.onmouseover = function(){

play(1);

}

box.onmouseout = function(){

play(0.3);

}

}

var alpha = 0.3 ;

function play(target){

var timer = null ;

var box = document.getElementById('box') ;?

clearInterval(timer);

timer = setInterval(function(){

var speed = 0 ;

if(alert > target){

speed = -0.1;

}else{

speed = 0.1 ;

}

if(alpha == target){

clearInterval(timer);

}else{

alpha = alpha + speed;

box.style.opacity = alpha;

}

},30);

}

就是看不出是哪里錯(cuò)了。。。。

正在回答

4 回答

window.onload = function() {

var box = document.getElementById('box');

box.onmouseover = function() {

play(1);

}

box.onmouseout = function() {

play(0.3);

}

}

var alpha = 0.3;

var timer = null;


function play(target) {

clearInterval(timer);

var box = document.getElementById('box');

var speed = 0;

timer = setInterval(function() {

if(alpha > target) {

speed = -0.01;?

} else {

speed = 0.01;

}

if(alpha == target) {

clearInterval(timer);

} else {

alpha = alpha + speed;

box.style.opacity = alpha;

}

}, 3);

}

這個(gè)是我復(fù)制你的代碼之后拉過去改的 ?測(cè)試可以 你對(duì)照下


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

任性不是罪 提問者

好噠,非常感謝?。。hank you !!!
2016-07-25 回復(fù) 有任何疑惑可以回復(fù)我~

window.onload = function() {

var box = document.getElementById('box');

box.onmouseover = function() {

play(100);

}

box.onmouseout = function() {

play(30);

}

var timer = null;//這倆貨既不在上面的{}里

var alpha = 30;//也不在下面的{}里

function play(target) {

clearInterval(timer);

timer = setInterval(function() {

var speed = 0;

if(alpha > target) {

speed = -10;

} else {

speed = 10;

}

if(alpha == target) {

clearInterval(timer);

} else {

alpha += speed;

box.style.opacity = alpha / 100;

}

}, 30);

}


}


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

腦闊疼

這個(gè)涉及到作用域的問題 全局變量 和臨時(shí)變量 建議你看看
2016-07-25 回復(fù) 有任何疑惑可以回復(fù)我~
#2

任性不是罪 提問者 回復(fù) 腦闊疼

恩呢,好噠
2016-07-25 回復(fù) 有任何疑惑可以回復(fù)我~

window.onload = function(){

var box = document.getElementById('box') ;?

var timer = null ;

box.onmouseover = function(){

play(100);

}

box.onmouseout = function(){

play(30);

}

function play(target){

var alpha = 30 ;

clearInterval(timer);

timer = setInterval(function(){

var speed = 0 ;

if(alpha > target){

speed = -10;

}else{

speed = 10 ;

}

if(alpha == target){

clearInterval(timer);

}else{

alpha += speed;

box.style.opacity = alpha/100;

}

},30);

}


}


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

第一:

if(alert > target){//這里應(yīng)該是 alpha

speed = -0.1;

}else{

speed = 0.1 ;

}

第二:

function play(target){

var timer = null ;//這個(gè)變量應(yīng)該聲明在方法體外面。

var box = document.getElementById('box') ;?


clearInterval(timer);


第三:

speed的絕對(duì)值為0.1 最后鼠標(biāo)移出div可能會(huì)閃屏 ?建議縮小 然后同時(shí)縮小相應(yīng)倍數(shù)計(jì)時(shí)器的間隔時(shí)間 達(dá)到效果不變


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

任性不是罪 提問者

已經(jīng)全部改過來了,可是還是不行。。。。
2016-07-25 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為啥我的鼠標(biāo)移出來的效果不顯示。。。。。

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

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

幫助反饋 APP下載

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

公眾號(hào)

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