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
Post a Comment