I want to display a zoom image (on mouseover) on top of certain images to imply 'click here to zoom'. I don't want to use a cursor.
I'm sure there's a good way to do this with javascript jQuery but I don't know it.
Does anyone have any good ideas?
I want to display a zoom image (on mouseover) on top of certain images to imply 'click here to zoom'. I don't want to use a cursor.
I'm sure there's a good way to do this with javascript jQuery but I don't know it.
Does anyone have any good ideas?
This jQuery plugin seems to do what you want, and you can easily customise it to fit your needs (i.e. implement click).
HTML:
<a href='big.jpg'>
<img src='mini.jpg' alt='a kitten'>
<span>Click to view larger</span>
</a>
CSS:
a > img + span {display: none}
a:hover > img + span {display: inline}
Then style however you like.
Do you want to use a zoom icon instead of the pointer cursor? Mozilla supports a zoom-cursor (http://www.worldtimzone.com/mozilla/testcase/css3cursors.html) but you will have to face the problem on IE. Perhaps you can have a hidden div with your custom zoom-icon like: yourcursor then you can play with the images and jquery:
$('img.zoomthis').mouseover(function(){ var pos = $(this).position(); $('#zoomcursor').css("position","absolute"); $('#zoomcursor').css("top",pos.top+18);//You have to change this in order to place it right over your image $('#zoomcursor').css("left",$(obj).width()-30); //this too $('#zoomcursor').show();
}).mouseout(function(){$('#zoomcursor').hide();
})