I am not a javascript expert, but should you wait with the function binding to the event until the page is fully loaded? So:
window.onload = function(){
$('.item1').bind('mouseleave',basic_nav_mouseout);
};
Also (correct me if I am wrong). I don’t think you should pass the object as an argument to 'basic_nav_mouseout ('. Item1 ',' red ')', you can just use the 'this' keyword. So:
function basic_nav_mouseout(){
this.css('background-image',"none");
}
I don't know anything about the JQuery library, but my only (small) experience is with the Prototype library.
source
share