jQuery - check if the element is visible and fade in -
i have <div>
element on page (let's has .myelement
class). have third-party script manipulates element , can change visibility style attribute "visibility: visible
".
i need check if .myelement's visibility :visible
, , if is, trigger jquery .fadein()
function.
i think mean check if element visible , if not, fade in. there no point in fading in element visible on page. if case should this:
var $element = $('.myelement'); if ($element.is(':visible')) { element.fadeout(); } else { element.fadein(); }
Comments
Post a Comment