我是菜鸟,各位大大帮忙把这段代码加加注。。
var isOpera, isIE, isNav, isFox, isOther = false;if (navigator.userAgent.indexOf("Opera")!=-1) {
isOpera = true;
} else if (navigator.userAgent.indexOf("Firefox")!=-1) {
isFox = true;
} else if (navigator.appName == "Microsoft Internet Explorer") {
isIE = true;
} else if (navigator.appName == "Netscape") {
isNav = true;
} else {
isOther = true;
}
function drawDiv(e)
{
if (isIE)
{
OffsetX = window.event.x;
OffsetY = window.event.y;
} else {
OffsetX = e.pageX - document.getElementById("imgs").offsetLeft;
OffsetY = e.pageY - document.getElementById("imgs").offsetTop;
}
var x = document.getElementById("popup")
x.style.display = 'block'
if (OffsetX<840)
{
x.style.left = OffsetX + 10
}
else
{
x.style.left = OffsetX - 130
}
x.style.top = OffsetY + 10
var _x = Math.floor(OffsetX/13) + 1
var _y = Math.floor(OffsetY/13) + 1
if (_y==134 && _x>25)
{
_x = _y = "超出范围";
}
var ytext = document.getElementById("Ytext")
ytext.innerHTML = "<B>行</B>:" +_y
var xtext = document.getElementById("Xtext")
xtext.innerHTML = "<B>列</B>:" +_x
}