0
これは非常に単純な作業ですが、どこかに間違いがあります。私はそれを見つけることができません。フェーディングが機能しません、JavaScript
function get(obj) { return document.getElementById(obj); }
var SomeObj = {
t1:null,t2:null,
hide: function() {
if(parseFloat(get("wr_st").style.opacity)>0.45) {
get("wr_st").style.opacity-=0.05;
} else {
clearInterval(SomeObj.t1);
}
},
show: function() {
if(parseFloat(get("wr_st").style.opacity)<1) {
get("wr_st").style.opacity+=0.05;
} else {
clearInterval(SomeObj.t2);
}
},
fade: function($wt) {
if($wt==1) {
clearInterval(menu.status.t2);
menu.status.t1=setInterval('SomeObj.hide();',10);
} else if($wt==2) {
clearInterval(menu.status.t1);
menu.status.t2=setInterval('SomeObj.show();',10);
}
}
}
私はinput(type = text)を持っています。属性付き:
onfocus="SomeObj.fade(1);"
onblur="SomeObj.fade(2);".
オンブラは機能しません。より正確には、これは動作しません:
get("wr_st").style.opacity+=0.05;
私は例:警告(「NOOOO」)のためにここに配置します場合は、不透明度+ = 0.5が機能しないので、常に処理中です。 あなたは私を助けることができますか:WTFはそれが&なぜ機能しないのですか?ありがとうございます..
'.opacity'を以下のように整数に変換しようとしました:' get( "wr_st")。style.opacity = parseInt(get( "wr_st")。style.opacity)+ 0.05'? – Yaniro