获取鼠标坐标

function mousePos(e){ 
	var x,y;
	var e = e||window.event;
	return { 
		x:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,
		y:e.clientY+document.body.scrollTop+document.documentElement.scrollTop 
	};
}
园子里看到的,据博主讲,兼容IE FF  chrome,
http://www.cnblogs.com/mingda/archive/2010/01/12/javascript_mouse_position_function.html
本人还没测试

posted on 2010-01-12 20:22  自信飞扬  阅读(199)  评论(0编辑  收藏  举报

导航