如何在jQuery中检查元素的不透明度是否为0,然后执行某些操作?
你尝试使用.css()了吗?
if($('elemFoo').css('opacity') == 0) {
doSomething();
}
$(function() {
if ($('#foo').css('opacity') == 0)
alert('lol');
});
Demo : http://jsfiddle.net/9GEZ5/
if( $("#id_of_your_thing").css('opacity') == "0" )
do_stuffs();
var currentOpacity = jQuery.fx.step.opacity
if(currentOpacity == 0)
{
...
要找到不透明度,你需要
var x = $('#test').css('opacity');
x==0 ? alert('opacity is 0') : alert('Opacity is not 0');
jquery.support.opacity
在 jQuery 1.7.1 上似乎有效