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

Popular posts from this blog

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -