javascript - JQuery Detect class changes -


i using plugin added class open .slide-out-div when opened.

so trying change css if open detected.

what need

if  $('.slide-out-div **open**') detected  $('.otherdiv').css('top','0px'); 

not sure how put together...

there no event of class-added, need track yourself...

it can done infinite loop settimeout check if class has changed.

function checkforchanges() {     if ($('.slide-out-div').hasclass('open'))         $('.otherdiv').css('top','0px');     else         settimeout(checkforchanges, 500); } 

you can call function when want, or ondom ready:

$(checkforchanges); 

Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -