Passing variable in jQuery through bind doesn't seem to work...
- by dallen
Here's my code that does work:
function mouseOver()
{
$(".beaver").fadeIn(100);
}
function mouseOut()
{
$(".beaver").fadeOut(100);
}
$("#group_beaver").bind('mouseenter', mouseOver).bind('mouseleave', mouseOut);
But why doesn't this work?
function mouseOver(variable)
{
$(variable).fadeIn(100);
}
function mouseOut(variable)
{
$(variable).fadeOut(100);
}
$("#group_beaver").bind('mouseenter', mouseOver('.beaver')).bind('mouseleave', mouseOut('.beaver'));