I have this snippet:
self.puff({duration: 0, queue: 'end',
afterFinish: Element.remove.bindAsEventListener(self)
});
Self is an element; it is supposed to remove an element from document when all effects on it are completed.
Unfortunately, this doesn't work, failing with "element.parentNode is undefined".
If I replace Element.remove.bindAsEventListener(self)
with function() { self.remove(); }
then it would. I've tried just bind() with the same results.
The question is: why doesn't it work, and how should I use bind()?
Bonus points for showing an easier way to remove an element after all effects on it are done.