1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
function initInfo() {
var style="position:absolute;top:0px;left:0px;visibility:hidden;z-index:10; background-color:#FFF; padding:5px; border:1px solid #828282;";
if (document.layers) {
window.captureEvents(Event.MOUSEMOVE);
window.onMouseMove = getMousePos;
document.write("<LAYER name='info' top='0' left='0' visibility='hide' onClick='javascript:hideInfo()' style='background-color:#FFF; padding:5px; border:1px solid #828282;'></LAYER>");
}
if (document.all) {
document.write("<DIV id='info' style='" + style + "' onClick='javascript:hideInfo()'></DIV>");
document.onmousemove = getMousePos;
} else if (document.getElementById) {
document.onmousemove = getMousePos;
document.write("<DIV id='info' style='" + style + "' onClick='javascript:hideInfo()'></DIV>");
}
}
var posX = 0;
var posY = 0;
var xOffset = 10;
var yOffset = 10;
function showInfo(content) {
var maxZoomSize = 350;
var finalPosX = posX - xOffset;
if (finalPosX < 0) finalPosX = 0;
if (document.layers) {
document.layers['info'].document.write(content);
document.layers['info'].document.close();
document.layers['info'].top = posY + yOffset;
document.layers['info'].left = finalPosX;
document.layers['info'].visibility = "show";
}
if (document.all) {
info.innerHTML = content;
document.all['info'].style.top = posY + yOffset + 'px';
document.all['info'].style.left = finalPosX + 'px';
document.all['info'].style.visibility = "visible";
} else if (document.getElementById) {
document.getElementById('info').innerHTML = content;
document.getElementById('info').style.top = posY + yOffset + 'px';
document.getElementById('info').style.left = finalPosX + 'px';
document.getElementById('info').style.visibility = "visible";
}
}
function hideInfo() {
if (document.layers) {
document.layers["info"].visibility="hide";
}
if (document.all) {
document.all["info"].style.visibility="hidden";
} else if (document.getElementById) {
document.getElementById("info").style.visibility="hidden";
}
} |
Partager