syntax - if statement in jQuery -


Is the correct jQuery syntax to check that div is hidden & amp; Is there a section of "visual"? If this happens, then reveal the next hidden division with the class "view" after the next .3 seconds?

Note that this is not currently working, it fades in all the hidden divs regardless of class.

  & lt; Script type = "text / javascript" & gt; $ (Function () {// divs showDiv ();}); Function showDiv () {// if hidden ($ ('div: hidden'). Length.hasClass ('view')) {// first of them $ ('div: hidden: first'). (); // wait for a second before fading in one setTimeout (showDiv, 300); }} & Lt; / Script & gt;    

Perhaps a better solution

  if ($ ('Div.view: hidden'). Length) {// $ ('div.view: hidden: first') fade out of them first. FadeIn (); // wait for a second before fading in one setTimeout (showDiv, 300); }    

Comments