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 <saavedra....@gmail.com> wrote:
> Did you try with
>
> $(this).setContent();
>
> instead of
>
> this.setContent();
>
> ?
>
> On 9 feb, 14:13, Creativebyte <michaelhaszpru...@googlemail.com>
> 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).fadeOut(1000, 
> > function(){
> >                         this.setContent();
> >                         this.fadeIn(1000)
> >                 });
> >         }
>
> > The problem is, that inside the fadeOut() function "this" is now not
> > the class but the jQuery element. So, how can I access my classes
> > methods and variables again sine I can't use "this"?
>
> > Thanks for your help!

Reply via email to