ericmmartin / simplemodal

A modal dialog framework for jQuery
http://simplemodal.com/
Other
506 stars 229 forks source link

delegate instead bind #40

Open yurks opened 10 years ago

yurks commented 10 years ago

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 commented 10 years ago

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

yurks commented 10 years ago

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 commented 10 years ago

sounds good