An example jsfiddle is here. Try to hover the red square and then hover the blue one. Why is it flickering? How can I prevent the blue square to disappear?
(This is actually a tab and it's ex icon, that appear only when hovered)
JavaScript:
$("#foo").live("mouseover mouseout", function(e) {
if (e.type == "mouseover") {
$("#foo").append("<div id='bar'>");
} else {
$("#bar").remove();
}
});
CSS:
#foo {
width: 100px;
height: 50px;
background: red;
}
#bar {
width: 10px;
height: 10px;
background: blue;
}
Thanks