i have the following object
function AnimatedObject(object)
{
this.object = object;
/*
Functions
*/
this.fadeOutAnimation = fadeOutAnimation;
this.objectToggle = objectToggle;
this.objectClick = objectClick;
}
function fadeOutAnimation()
{
this.object.animate({
opacity: 0.25,
left: "+=150",
height: "toggle"
}, 2500, function() {
this.objectToggle();
});
}
function objectToggle()
{
this.object.toggle();
}
From inside my animate function i am called this.objectToggle();
However when it completes the animation i get undefined is not a function
I am quite certian that it is because of the inner callback function that does not have a reference to the object
My question is how can i give it a reference to my object and thereby allow me to call its functions from inside the callback function?