[jQuery] Re: jquery, OOP and this - Problem

2009-02-09 Thread Creativebyte
yes, I did. But since "this" is the element that I selected (a DIV) it was of no use. the class I wrote is not a jqeury extension, it's a separate item. But using the "trick" of storing "this" in an outside variable did the trick like Ricardo Tomasi wrote. On 9 Feb., 20:09, SoulRush wrote: > Did

[jQuery] Re: jquery, OOP and this - Problem

2009-02-09 Thread Creativebyte
Thanks! That worked great! On 9 Feb., 20:09, Ricardo Tomasi wrote: > just stay aware of the scope: > > var oldthis = this; > this.slide=function(){ >     $(this.container_selector_contents).fadeOut(1000, function(){ >              oldthis.setContent(); >              oldthis.fadeIn(1000) >      

[jQuery] Re: jquery, OOP and this - Problem

2009-02-09 Thread Ricardo Tomasi
Oh, I thought setContent() was one of his class' methods. Does it make sense to do something like this.slide=function() {.. on a jQuery object? On Feb 9, 5:57 pm, Eric Garside wrote: > Yea, the scope should be fine. You just have to wrap "this" in "$()" > when using the reference to the element.

[jQuery] Re: jquery, OOP and this - Problem

2009-02-09 Thread Eric Garside
Yea, the scope should be fine. You just have to wrap "this" in "$()" when using the reference to the element. On Feb 9, 2:09 pm, SoulRush wrote: > Did you try with > > $(this).setContent(); > > instead of > > this.setContent(); > > ? > > On 9 feb, 14:13, Creativebyte > wrote: > > > Hello group,

[jQuery] Re: jquery, OOP and this - Problem

2009-02-09 Thread SoulRush
Did you try with $(this).setContent(); instead of this.setContent(); ? On 9 feb, 14:13, Creativebyte wrote: > Hello group, > > I got a problem with a JS class I am writing. I got the following > piece of code: > > this.slide=function(){ >                 $(this.container_selector_contents).f

[jQuery] Re: jquery, OOP and this - Problem

2009-02-09 Thread Ricardo Tomasi
just stay aware of the scope: var oldthis = this; this.slide=function(){ $(this.container_selector_contents).fadeOut(1000, function(){ oldthis.setContent(); oldthis.fadeIn(1000) }); } ; On Feb 9, 3:13 pm, Creativebyte wrote: > Hello group, > > I got a problem