javascript - jQuery hover functions IE error -
javascript - jQuery hover functions IE error -
i've been having difficulty jquery hover functions. proberbly result of staring @ same code far long, perhaps can help.
i have next function:
$("#div1").mouseover(function () { $("#div2:hidden").show(); }); $("#div1").mouseout(function () { $("#div2:visible").hide(); });
which have tried as:
$("#div1").hover(function () { $("#div2:hidden").show(); }, function() { $("#div2:visible").hide(); });
neither work @ in ie. write using mouseover, hover, mouseout or other "mouse" function causes errors in ie. other browsers perfect , what's more annoying works in ie, instance on occasion first , sec time work - error.
any help fantastic!
it works fine here: http://jsfiddle.net/u89de/1/
your first code wrong. improve using:
$('#div1').mouseover(function() { // mouseover event }).mouseout(function() { // mouseout event });
if utilize jquery 1.7 or higher it's improve utilize .on()
:
$('#div1').on({ mouseover : function() { // mouseover event }, mouseout : function() { // mouseout event } });
javascript jquery
Comments
Post a Comment