This is what I have so far:
<img src="images/test.jpg"
class="black"
onmouseout="this.style.opacity=1;
this.filters.alpha.opacity=100;
this.style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"
onmouseover="this.style.opacity=0.3;
this.filters.alpha.opacity=30;
this.style.filter='p开发者_高级运维rogid:DXImageTransform.Microsoft.Alpha(Opacity=30)'"
/>
It's works in FF and Safari, but not IE 7 or 8.
Suggestions?Ugh! CSS for the win!
<style>
img.black:hover {opacity: 0.3; filter:alpha(opacity=30);}
</style>
Lose the this.filters.alpha.opacity=30
line. Corrected code:
<img src="images/test.jpg" class="black"
onmouseout="this.style.opacity=1;
this.style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=100)'"
onmouseover="this.style.opacity=0.3
this.style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=30)'"
/>
Have you considered using a framework like YUI or JQuery to help you normalize cross-browser inconsistencies like this?
精彩评论