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

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

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