simplemodal icon indicating copy to clipboard operation
simplemodal copied to clipboard

delegate instead bind

Open yurks opened this issue 10 years ago • 3 comments

instead $('.' + s.o.closeClass).bind('click.simplemodal', ... better use $(document_or_body).delegate('click.simplemodal', '.' + s.o.closeClass, ... as click button could appear a bit later after .bindEvents() called

yurks avatar Oct 07 '13 08:10 yurks

Use .on not delegate it's obsolete. But you should specify the parent and the child you are trying to bind an event

talamaska avatar Oct 16 '13 16:10 talamaska

Description updated, code has mistake, thank you. And if we take care of jquery < 1.7 we should use .delegate(), as it not deprecated and just an alias for .on() in jquery >= 1.7

yurks avatar Oct 17 '13 07:10 yurks

sounds good

talamaska avatar Oct 17 '13 09:10 talamaska