I have a hidden DIV with the zoom image.
#zoom-icon{
width:16px;
position:absolute;
display:inline;
z-index:9999;
}
<div id="zoom-icon"><ul id="icons" class="ui-widget ui-helper-clearfix"><li class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-circle-plus"></span></li></ul></div>
This is the Javascript for the zoom class hover:
$("img.zoom").hover(
function() {
var offset = $(this).offset();
var lft = offset.left + (this.width - 16);
var tp = offset.top;
var s = this.src;
$("#zoom-icon").css({left: lft, top: tp});
$("#zoom-icon").show();
//$("#zoom-icon").hover(function(){ $(this).show()});
$("#zoom-icon").click(function(){
// ... click function ...
});
});
The HTML of one of the images with the class zoom:
<a href="#"><img src="image_loc" width="320" height="223" alt="sample one" class="zoom"/></a>
Like I said I can get the icon to appear and in the proper location but when I hover over it it disappears or blinks repeatedly...any suggestions much appreciated.
UPDATE
It appears that the problem is with the function that hides the icon. I have that event binded to the mouseout of the image.zoom. However, when the mouse moves onto the icon, focus seems to be removed from the image so the image fires the mouseout event.
How do I go about keeping the icon static while I mouse over it and the hide it when my mouse leaves the image.zoom???