The confusion is how the on () function works. In jQuery, when you say $ (document) .on (xx, "#popup", yy), you try to fire yyy whenever the xx event reaches the document, but the original target was "#popup".
If the document does not receive the xx event, then it does not bubble! See the jQuery On documentation for details, but the three load, error, and scroll events do not create DOM bubbles.
This means that you need to attach the event directly to the element receiving it. $ ("# Popup") on (xx, yy).
Venar303 Dec 28 '12 at 18:19 2012-12-28 18:19
source share