General Question
The png looks bad in IE7 after I change its opacity with javascript?
these day i m working on a web app, and i want to design a control panel in it, when i press mouse down on this panel the javascript codes change its opacity(opacity=70,and i can drag it),and when the mouse up it return back to the normal status(opacity=100),
......
$(ele).onmousedown=function(e){
dragElement.gos=true;
var e=e||window.event;
dragElement.x=e.clientX;
dragElement.y=e.clientY;
dragElement.l=$(drago).offsetLeft;
dragElement.t=$(drago).offsetTop;
$(drago).style.left=dragElement.l+“px”;
$(drago).style.top=dragElement.t+“px”;
$(drago).style.filter=“alpha(opacity=”+70+”)”; //ie7 sucks
$(drago).style.opacity=0.7;
}
$(ele).onmousemove=function(e){
if(dragElement.gos!=true)
return;
var e=e||window.event;
$(drago).style.left=dragElement.l+e.clientX-dragElement.x+“px”;
$(drago).style.top=dragElement.t+e.clientY-dragElement.y+“px”;
}
$(ele).onmouseup=function(){
$(drago).style.filter=“alpha(opacity=”+100+”)”;
$(drago).style.opacity=1;
dragElement.gos=false;
}
......
}
theres some pics that show u the detail of this problem:
heres the panel’s normal state:
http://clip2net.com/clip/m3651/1212664842-clip-30kb.jpg
mousedown in firefox,this is what i want:
http://clip2net.com/clip/m3651/1212664886-clip-30kb.jpg
but this is what happens in ie7,the black border appears(but i didnt set the “border” attribute in css and js),its sucks:
http://clip2net.com/clip/m3651/1212664813-clip-36kb.jpg
and mouseup in firefox,return back to the normal staus,looks good:
http://clip2net.com/clip/m3651/1212664842-clip-30kb.jpg
mouseup in ie7, the black border still exist:
http://clip2net.com/clip/m3651/1212665678-clip-31kb.jpg
is this ie7 bug? why and how? thanx
7 Answers
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.