快捷搜索:

基于jquery的获取mouse坐标插件的实现代码_jquery_脚

2019-11-26 作者:白姐四不像必中一肖图   |   浏览(67)

复制代码 代码如下:/* * Copyright 2010 刘建华 * *正版香港马报免费资料, The above copyright notice shall be * included in all copies or substantial portions of the Software. * Example:

demo

demo

*/ /* * mouse Plugin for jQuery * Version: 1.0 * Release: 2010-03-30 */ { //Main Method jQuery.mouse = function{ var mouseleft = 0; var mousetop = 0; if(!($.browser.msie && /MSIEs/.test) { mouseleft=e.pageX; mousetop=e.pageY; } else { var _top = document.compatMode=="CSS1Compat" ? document.documentElement.scrollTop : document.body.scrollTop; var _left = document.compatMode=="CSS1Compat" ? document.documentElement.scrollLeft : document.body.scrollLeft; mouseleft=_left+event.clientX; mousetop=_top+event.clientY; } return {left:mouseleft,top:mousetop} ; }; });

本文由正版香港马报免费资料发布于白姐四不像必中一肖图,转载请注明出处:基于jquery的获取mouse坐标插件的实现代码_jquery_脚

关键词: