Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delegate instead bind #40

Open
yurks opened this issue Oct 7, 2013 · 3 comments
Open

delegate instead bind #40

yurks opened this issue Oct 7, 2013 · 3 comments

Comments

@yurks
Copy link

yurks commented Oct 7, 2013

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

@talamaska
Copy link

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

@yurks
Copy link
Author

yurks commented Oct 17, 2013

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

@talamaska
Copy link

sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants