Click to See Complete Forum and Search --> : turn cursor into magnefying lens?
ktsirig
October 28th, 2006, 07:39 AM
Hello,
I was wondering if there are any scripts available which will help me transform the mouse cursor into a magnefying lens once it hovers over an image. I think that onmouse.hover will be what I need, but what about the image of the lens? Are there any images like this ready?
Thank you!
PeejAvery
October 28th, 2006, 09:57 AM
You can change enlarge the image (examples are everywhere here at CG, just search), but you cannot magnify parts of the image.
I hope that answers your question. If not, please explain.
code?
November 4th, 2006, 05:02 PM
http://www.dynamicdrive.com/
There's a magifying box script in there somewhere, just modify it to show only on the picture onmouseover
here, i found it
http://www.dynamicdrive.com/dynamicindex3/zoom.htm
try this
<style>
.Tooltip
{
border:1px solid black;
font-size:10px;
layer-background-color:lightyellow;
background-color:lightyellow;
position: absolute;
}
A
{
color: blue;
}
</style>
<script language="javascript">
var tip = new Array();
// add as many tips as you want
// if you want html in tips, then change "Tooltip.innerText" to "Tooltip.innerHTML"
function TipShow(current, e, num)
{
Tooltip.innerText = tip[num];
Tooltip.style.height = 15;
Tooltip.innerHTML += "<br/><img src='" + current.src + "'/>";
Tooltip.style.visibility = "visible";
}
function UpdateMouse()
{
Tooltip.style.left = event.clientX + document.body.scrollLeft;
Tooltip.style.top = event.clientY + document.body.scrollTop + 20;
}
function TipHide()
{
Tooltip.style.visibility = "hidden";
}
</script>
<img src="your img"onmouseover="TipShow(this,event,[tip array number]);" onmouseout="TipHide();"
for each image that you want to enlarge, add
onmouseover="TipShow(this,event,[tip array number]);" onmouseout="TipHide();"
if you want to add image sizes, go to where it says Tooltip.innerHTML += "<br/><img src='" + current.src + "'/>";
and add a height and width setting
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.