* Dual licensed under the MIT (MIT-LICENSE.txt)\r
* and GPL (GPL-LICENSE.txt) licenses.\r
* \r
- * Revision: $Id:$\r
+ * Revision: $Id: $\r
*/\r
;(function($) {\r
\r
}\r
var noneUrl = ['cursors', OS == 'other' ? 'win' : OS, 'none' + ($.browser.safari ? '.png' : '.cur')].join('/');\r
\r
- this.fakemouse = $('<img src="' + defaultUrl + '" />');\r
- this.realmouse = $('<img src="' + defaultUrl + '" />');\r
+ var fakemouse = $('<img src="' + defaultUrl + '" />');\r
+ var realmouse = $('<img src="' + defaultUrl + '" />');\r
if ($.browser.msie && $.browser.version == 6) {\r
- this.fakemouse = $('<div style="height:32;width:32;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\');" ></div>');\r
- this.realmouse = $('<div><div style="height:32;width:32;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\');" ></div></div>');\r
+ fakemouse = $('<div style="height:32;width:32;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\');" ></div>');\r
+ realmouse = $('<div><div style="height:32;width:32;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\');" ></div></div>');\r
}\r
- this.mousescreen = $('<div/>');\r
+ var mousescreen = $('<div/>');\r
\r
- this.updateCursor = function() {\r
+ var updateCursor = function() {\r
if ($.browser.msie && $.browser.version == 6) {\r
- self.fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + cursorUrl() + '\', sizingMethod=\'scale\'');\r
+ fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + cursorUrl() + '\', sizingMethod=\'scale\'');\r
} else {\r
- self.fakemouse.attr('src', cursorUrl());\r
+ fakemouse.attr('src', cursorUrl());\r
}\r
}\r
- this.resetCursor = function() {\r
+ var resetCursor = function() {\r
if ($.browser.msie && $.browser.version == 6) {\r
- self.fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\'');\r
+ fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\'');\r
} else {\r
- self.fakemouse.attr('src', defaultUrl);\r
+ fakemouse.attr('src', defaultUrl);\r
}\r
}\r
\r
var testStart = function() {\r
- self.element.bind("mouseover", self.updateCursor).bind("mouseout", self.resetCursor);\r
- self.fakemouse.appendTo('body').css({ position: 'absolute', left: self.mouseX, top: self.mouseY, zIndex: 5000 });\r
- self.realmouse.appendTo('body').css({ position: 'absolute', left: self.mouseX, top: self.mouseY, zIndex: 5000, opacity: 0.1 });\r
- self.mousescreen.appendTo('body').css({ width: '100%', height: '100%', position: 'absolute', top: 0, left: 0, zIndex: 5000 })\r
- .mousemove(function(e) { self.realmouse.css({ left: e.pageX, top: e.pageY }); return false; })\r
+ self.element.bind("mouseover", updateCursor).bind("mouseout", resetCursor);\r
+ fakemouse.appendTo('body').css({ position: 'absolute', left: self.mouseX, top: self.mouseY, zIndex: 5000 });\r
+ realmouse.appendTo('body').css({ position: 'absolute', left: self.mouseX, top: self.mouseY, zIndex: 5000, opacity: 0.1 });\r
+ mousescreen.appendTo('body').css({ width: '100%', height: '100%', position: 'absolute', top: 0, left: 0, zIndex: 5000 })\r
+ .mousemove(function(e) { realmouse.css({ left: e.pageX, top: e.pageY }); return false; })\r
.mousedown(function() { return false; })\r
.mouseup(function() { return false; });\r
- self.mousescreen.css('cursor', 'url(' + noneUrl + '), crosshair');\r
+ mousescreen.css('cursor', 'url(' + noneUrl + '), crosshair');\r
($.browser.opera && mousescreen.css('cursor', 'crosshair'));\r
}\r
var testStop = function() {\r
- self.element.unbind("mouseover", self.updateCursor).unbind("mouseout", self.resetCursor);\r
- self.mousescreen.remove();\r
- self.mouseX = self.realmouse.css("left");\r
- self.mouseY = self.realmouse.css("top");\r
- self.realmouse.remove();\r
- self.fakemouse.remove();\r
+ self.element.unbind("mouseover", updateCursor).unbind("mouseout", resetCursor);\r
+ mousescreen.remove();\r
+ self.mouseX = realmouse.css("left");\r
+ self.mouseY = realmouse.css("top");\r
+ realmouse.remove();\r
+ fakemouse.remove();\r
($.isFunction(complete) && complete.apply());\r
}\r
\r
\r
this.lastX = null;\r
\r
- this.fakemouse\r
+ fakemouse\r
.animate({ left: this.left, top: this.top }, this.options.speed, function() {\r
self.element.triggerHandler('mouseover');\r
self.down(self.left, self.top);\r
complete: function() {\r
self.element.triggerHandler('mouseout');\r
self.up(0, 0);\r
- $(this).animate({ left: self.realmouse.css("left"), top: self.realmouse.css("top") }, {\r
+ $(this).animate({ left: realmouse.css("left"), top: realmouse.css("top") }, {\r
speed: self.options.speed,\r
complete: function() {\r
testStop();\r