det er et javascript der gør tricket og det ser sådan ud:
var thumpImg = new Image();
var thumpInt;
var minibannerArray = new Array();
function checkImg(imgName) {
if (thumpImg.readyState == "complete" || thumpImg.readyState == 4) {
document.all.thumpPic.innerHTML = "<img src='" + imgName + "'>";
if (imgWidth) {
objDivStyle.width = (imgWidth + windowPadding);
objDivStyle.height = (imgHeight + windowPadding);
}
clearInterval(thumpInt);
}
}
function showPop(imgName,hideSwitch) {
thumpImg.src = imgName;
imgWidth = thumpImg.width;
imgHeight = thumpImg.height;
thumpInt = window.setInterval("checkImg('" + imgName + "')",100);
windowPadding = 24;
if (mouseThumpX + imgWidth + 24 + 20 >= document.body.clientWidth) {
objDivStyle.left = mouseThumpX - (imgWidth + 24 + 30);
}
if ((mouseThumpY - document.body.scrollTop) + imgHeight + windowPadding > document.body.clientHeight) {
objDivStyle.top = (mouseThumpY - (((mouseThumpY - document.body.scrollTop) + imgHeight + windowPadding + 10) - document.body.clientHeight));
}
if (document.all.minibannerTabel && hideSwitch) {
minibannerArray = new Array();
if (document.all.minibannerTabel.innerHTML.indexOf(".swf") != -1) {
minibannerArray[minibannerArray.length] = document.all.minibannerTabel;
document.all.minibannerTabel.style.visibility = "hidden"
}
else if (document.all.minibannerTabel.all.tags("SELECT") && document.all.minibannerTabel.all.tags("SELECT").length > 0) {
for (i = 0; document.all.minibannerTabel.all.tags("SELECT")[i]; i++) {
minibannerArray[minibannerArray.length] = document.all.minibannerTabel.all.tags("SELECT")[i];
document.all.minibannerTabel.all.tags("SELECT")[i].style.visibility = "hidden";
}
}
}
document.all.thumpLayer.style.visibility = "visible";
}
function hidePop() {
if (document.all) {
document.all.thumpLayer.style.visibility = "hidden";
document.all.thumpLayer.style.backgroundColor = strPopBG;
if (minibannerArray.length > 0)
for (i = 0; minibannerArray[i]; i++) minibannerArray[i].style.visibility = "visible";
document.all.thumpPic.innerHTML = "<img src='/images/misc/clock.gif'>";
clearInterval(thumpInt);
}
}
var strPopBG;
function positionPop(imgName,hideSwitch,specialPopBG) {
if (document.all) {
mouseThumpX = event.clientX - event.offsetX + document.body.scrollLeft + 20;
mouseThumpY = event.clientY - event.offsetY + document.body.scrollTop;
objDivStyle = document.all.thumpLayer.style;
objDivStyle.left = mouseThumpX;
objDivStyle.top = mouseThumpY;
strPopBG = objDivStyle.backgroundColor;
if (typeof specialPopBG == "string") objDivStyle.backgroundColor = specialPopBG;
objDivStyle.visibility = "visible";
if (typeof hideSwitch != "number") hideSwitch = 0;
showPop(imgName,hideSwitch);
}
}
function bigPicPop_tmp(bigImgName,picWidth,picHeight,picType,AnnonceId) {
hidePop();
picWidth = picWidth + 20;
picHeight = picHeight + 50;
winX = (screen.availWidth - picWidth)/2;
winY = (screen.availHeight - picHeight)/2 - 12;
picWind = window.open("/asp/soegning/picpop.asp?AnnonceId="+AnnonceId+"&picType="+picType+"&ImgName="+bigImgName, "blank_", "resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,screenY=" + winY + ",top=" + winY + ",screenX=" + winX + ",left=" + winX + ",width= " + picWidth + ",height= " + picHeight + "");
picWind.focus();
}
function bigPicPop(Url,picWidth,picHeight,AnnonceId) {
hidePop();
picWidth = picWidth + 20;
picHeight = picHeight + 80;
winX = (screen.availWidth - picWidth)/2;
winY = (screen.availHeight - picHeight)/2 - 12;
picWind = window.open("/asp/soegning/picpop.asp?AnnonceId="+AnnonceId+"&Url="+Url, "blank_", "resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,screenY=" + winY + ",top=" + winY + ",screenX=" + winX + ",left=" + winX + ",width= " + picWidth + ",height= " + picHeight + "");
picWind.focus();
}
Det bruges således:
<a href='java script:void 0;' onMouseOver="positionPop('
http://www1.dba.dk/images/annbilleder/1/33/32480633_1.jpg');" onMouseOut="hidePop();" onMouseUp="bigPicPop('
http://www1.dba.dk/images/annbilleder/3/33/32480633_1.jpg',350,262,32480633);"><img SRC='/images/iconer/cam_5.gif' border='0'></a>