admin管理员组文章数量:1418103
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='progid:DXImageTransform.Microsoft.Alpha(Opacity=30)'"
/>
It's works in FF and Safari, but not IE 7 or 8.
Suggestions?
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='progid:DXImageTransform.Microsoft.Alpha(Opacity=30)'"
/>
It's works in FF and Safari, but not IE 7 or 8.
Suggestions?
3 Answers
Reset to default 2Ugh! 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?
本文标签: transparencyonmouseover javascript opacity for IE8 and IE7Stack Overflow
版权声明:本文标题:transparency - onmouseover javascript opacity for IE8 and IE7 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745273174a2651020.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论