I am using jquery so that when an image is hovered over, a popup div appears with data from an Ajax call.
I am testing in both IE and FF and the DIV is not playing nicely! Basically, it is closing for no reason (without moving the mouse). Sometimes its as if it has started the hoveroff event strait away.
I suppose flicking is the term you could use.
I’ve looked on Google but can’t find any information that seems to be relevant. Anybody have an ideas why this would be? My code is below:
JS
$(document).ready(function() {
$(".hover").hover(
function(e){
var ref = $(this).attr("wsref");
var url = "https://site/_ref/shop/_base/order_status.php?action=getstatus&ref="+ref+"&sid="+Math.random();
$("#status").show();
var height = $(".status").height();
var width = $(".status").width();
leftVal = e.pageX - width -10 + "px";
topVal = e.pageY - height -10 + "px";
$("#status").css({left:leftVal,top:topVal});
$("#status").html("<div id='loading'></div>").load(url);
},
function() {
setTimeout('$("#status").hide()',1500);
});
});
HTML
<img class="hover" title="Order Received" name="Order Received" src="https://site/_ref/images/cart.png" wsref="002731"/>
Try this
After you hide make isShowing=false; you can also implement with out using isShowing variable, by looking into the display in style attribute of your status element.