Is there a way i can pass information into a nested function ? The problem is i want to use jQuery to animate an object being removed and then after have it remove the object from the dom. But theres no way to pass information into the nested function. I first though the bellow would work but no luck,
tab = this.tab //this.tab is a dom element
$(this.tab).effect('drop',null,null, function(tab)
{
$(tab).remove()
})
People have suggested that i store the element in a global put this function is part of a class and there can be many objects which may call this function at the same time.
Thankyou!
thisinside the closure refer to the object being animated? jQuery is quite clever in setting context, tryconsole.loggingthisinside the closure.