Re: [jQuery] custom event firing

2009-11-26 Thread stworthy
The function of your plugin is to trigger the event 'myEvent'. The first time you invoke the hilight() method but now the 'myEvent' event not bind to '#myDiv',so you cannot get the alert information. The second time you click, the '#myDiv' has bind 'myEvent' one time, so you get the alert informa

Re: [jQuery] custom event firing

2009-11-25 Thread waseem sabjee
i usually use something like this when coding a jQuery plugin. (function() { var newMethods = { // function start AddTo : function(options) { var defaults = { // set default option values here }; var options = $.extend(defaults, options); // access any options below