Set opacity with javascript in IE 8?

荒凉一梦 提交于 2020-01-14 01:48:04

问题


How can I get this "opacity-fallback" to work in IE 8?

I only want to use pure Javascript, no CSS or jQuery.

http://jsfiddle.net/snabbdesign/LeLfB/11/


回答1:


 e.filter = "alpha(opacity:" + value * 100 + ")";

needs to be

e.style.filter = 'alpha(opacity=' + value*100 + ')'; 

notice style and the =



来源:https://stackoverflow.com/questions/8845287/set-opacity-with-javascript-in-ie-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!