Closed qayyumabro closed 5 years ago
Hey @qayyumabro. Nice to see that it helped. Unfortunately, nested classes are not supported in leave
(they are supported in arrive
function though). You can do something like this:
$(document).leave(".jfk-butterBar-shown", function() {
// additional checks here to make sure it's right element
})
From the documentation:
The first argument to leave must not be a descendent or child selector i.e. you cannot pass .page .test-elem
, instead, pass .test-elem
. It's because of a limitation in MutationObserver's api.
Thanks Uzair, that makes sense.
Hi Uzair, it's a nice library that you have developed, Unfortunately, I just found it today and needed it badly in the projects that I already developed. Your library could have saved a lot of hours :).
I just checked it for an element which contains multiple class names, but it didn't fire. Am I doing it right?
$(document).leave(".jfk-butterBar .jfk-butterBar-info .jfk-butterBar-shown", function() { var $removedElem = $(this); alert('loaded'); })