<div id="imgbox"></div>
<script type="text/javascript">
function Large(obj) {
var imgbox = document.getElementById("imgbox");
imgbox.style.visibility = 'visible';
var img = document.createElement("img");
img.src = obj.src;
img.style.width = obj.width * 2;
img.style.height = obj.height * 2;
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";
}
</script>
movable div
Gönderen
pantepember
18 Nisan 2009 Cumartesi