I have a column in a gridview that fills with images from the gridview. I am very new to javascript so I googled until I found a good javascript function that enlarges this image onmouseover.
it works great. my only problem is that this is not exactly what I want to do. I want a small image of a camera to be in the column. when they put their mouse over the image of the camera, the image that really belongs in that column should popup in the div. thanx so much.
Code:
function Large(obj)
{
var imgbox=document.getElementById("imgbox");
imgbox.style.visibility='visible';
var img = document.createElement("img");
img.src=obj.src;
img.style.height="180px";
imgbox.innerHTML='';
imgbox.appendChild(img);
}
function Out(obj)
{
document.getElementById("imgbox").style.visibility='hidden';
}
function Move(obj,e)
{
var mouseY=e.clientY;
// alert(e.x)
var mouseX=e.clientX;
var scrollTop=document.documentElement.scrollTop;
var scrollLeft=document.documentElement.scrollLeft;
var y=scrollTop+mouseY+20;
var x=scrollLeft+mouseX+20;
document.getElementById("imgbox").style.left=x + "px";
document.getElementById("imgbox").style.top=y + "px";
}
function Change(obj, evt)
{
if(evt.type=="focus")
obj.style.borderColor="red";
else if(evt.type=="blur")
obj.style.borderColor="green";
}
Comment