[jQuery] Re: jquery plugin + problem with return for this element

2007-10-25 Thread Erik Beeson
Despite the fact that you code is a bit of a mess, your problem is just that since you aren't defining the variable callback with var callback = ..., it's being made a global variable, and as a global variable, each time you call $(...).test1(...), you're overwriting callback. Same for ttt. Adding

[jQuery] Re: jquery plugin + problem with return for this element

2007-10-25 Thread [EMAIL PROTECTED]
On 25 Paź, 11:12, Erik Beeson [EMAIL PROTECTED] wrote: Despite the fact that you code is a bit of a mess, your problem is just that since you aren't defining the variable callback with var callback = ..., it's being made a global variable, and as a global variable, each time you call

[jQuery] Re: jquery plugin + problem with return for this element

2007-10-24 Thread Mike Alsup
Hi I'm trying to create plugin for jquery... I have almost everything, but when Im using my plugin on more then one elements then I have problem... You're not getting 'this' correct. Where you set 'b', 'this' is the jQuery object, not an element. So 'b' is a jQuery object that wraps

[jQuery] Re: jquery plugin + problem with return for this element

2007-10-24 Thread [EMAIL PROTECTED]
You're not getting 'this' correct. Where you set 'b', 'this' is the jQuery object, not an element. So 'b' is a jQuery object that wraps three dom elements. Here's a hint: (function($) { $.fn.test2 = function(color) { // 'this' is the jQuery object return