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

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -