Check opacity by jQuery
43,160
Solution 1
Have you tried using .css()?
if($('elemFoo').css('opacity') == 0) {
doSomething();
}
Solution 2
You can do as
$(function() {
if ($('#foo').css('opacity') == 0)
alert('lol');
});
Demo : http://jsfiddle.net/9GEZ5/
Solution 3
if( $("#id_of_your_thing").css('opacity') == "0" )
do_stuffs();
Author by
James
Updated on August 29, 2020Comments
-
James almost 4 years
How do I check if the opacity of an element is 0, and then do something in jQuery?