I have this class/function
function Menu()
{
this.closetimer = 0;
this.dropdown = 0;
}
Menu.prototype.menuTimer = function()
{
this.closetimer = setTimeout(function()
{
this.menuClose();
}, this.timeout);
}
Menu.prototype.menuClose = function()
{
if(this.dropdown) this.dropdown.css('visibility','hidden');
}
I want to call the function menuClose()
which is part of the Menu class, but I think this code actually tries to call menuClose()
from the closetimer
object.
How do I reference menuClose()
from the Menu object from within menuTimer()
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…