var restrictX;
var restrictY;
var tip;
// 鼠標坐標
function mousePosition(ev) {
return {
x : ev
y : ev
};
}
// 鼠標事件
function mouseMove(ev) {
ev = ev || window
var mousePos = mousePosition(ev);
restrictX = mousePos
restrictY = mousePos
}
document
document
上面的代碼在谷歌和搜狐浏覽器中獲取的值會不准確
var restrictX;
var restrictY;
var tip;
// 鼠標坐標
function mousePosition(ev){
var scrollLeft = document
var scrollTop = document
return {
x:ev
y:ev
};
}
// 鼠標事件
function mouseMove(ev){
ev = ev || window
var mousePos = mousePosition(ev);
restrictX = mousePos
restrictY = mousePos
}
document
document
var scrollLeft = document
var scrollTop = document
這兩句為
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20065.html