I need to raise a couple of events with parameters within a jquery plugin, looked at similar questions, but cant seem to see what I am looking for? ANy basic examples out there?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
if i understand well you want to provide some callbacks, being able to call them as
the way i do this is by adding an option ‘onInit’ to the plugin and call options.onInit(var1, var2, …) inside the plugin in the place where i want it executed
now the former code will execute alert(‘initializing…’); on init and alert(‘clicked!’); on click
i am not sure this code follows any official syntax, but it works well
if you just want to bind some custom events it is simple as described in http://api.jquery.com/bind/, just
then use