</style>\r
\r
<script type="text/javascript">\r
-$(function() {\r
\r
- var fakemouse = $('<img src="images/cursor.png" id="fakemouse>').appendTo('body')\r
- .css({ opacity: 0.0 })\r
- .hide();\r
+var mouseX = 0, mouseY = 0;\r
\r
- var realmouse = $('<img src="images/cursor.png" id="realmouse>').appendTo('body')\r
- .css({ opacity: 0.2 })\r
- .hide()\r
- .mousedown(function() { return false; });\r
- \r
- $(document).mousemove(function(e) {\r
- if (e.originalEvent && e.originalEvent.isTrusted) {\r
- realmouse.css({\r
- left: e.pageX,\r
- top: e.pageY\r
- });\r
- }\r
- });\r
+$(function() {\r
\r
+$(document).mousemove(function(e) {\r
+ if (e.originalEvent && e.originalEvent.isTrusted) {\r
+ mouseX = e.pageX;\r
+ mouseY = e.pageY;\r
+ }\r
});\r
-</script>\r
\r
-<script type="text/javascript">\r
+});\r
\r
function testMouse(type, el, x, y) {\r
var evt = document.createEvent("MouseEvents");\r
var left = center.x;\r
var top = center.y;\r
\r
- var lastX = null;\r
+ var fakemouse = $('<img src="images/cursor.png" id="fakemouse>');\r
+ var realmouse = $('<img src="images/cursor.png" id="realmouse>');\r
+ var mousescreen = $('<div id="mousescreen"/>');\r
\r
var testStart = function() {\r
- $(el).data("_ignoreTrusted.draggable", true);\r
+ fakemouse.appendTo('body').css({ left: mouseX, top: mouseY, opacity: 1.0 });\r
+ realmouse.appendTo('body').css({ left: mouseX, top: mouseY, opacity: 0.2 })\r
+ .mousedown(function() { return false; });\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
$("body").addClass("testing");\r
}\r
var testStop = function() {\r
$("body").removeClass("testing");\r
- $(el).data("_ignoreTrusted.draggable", false); \r
+ mousescreen.remove();\r
+ realmouse.remove();\r
+ fakemouse.remove();\r
}\r
\r
testStart();\r
\r
- $('#fakemouse').css({ left: realmouse.css("left"), top: realmouse.css("top") })\r
- .animate({ left: left, top: top, opacity: 1.0 }, "slow", function() {\r
+ var lastX = null;\r
+ fakemouse\r
+ .animate({ left: left, top: top, opacity: 1.0 }, "fast", function() {\r
testMouseDown(el, left, top);\r
})\r
.animate({ left: left + dx, top: top + dy }, {\r
- speed: "slow",\r
+ speed: "fast",\r
easing: "swing",\r
step: function (xory) {\r
if (!lastX) { lastX = xory; }\r
},\r
complete: function() {\r
testMouseUp(el, 0, 0);\r
- $(this).animate({ left: realmouse.css("left"), top: realmouse.css("top"), opacity: 0 }, {\r
- speed: "slow",\r
+ $(this).animate({ left: realmouse.css("left"), top: realmouse.css("top"), opacity: 1.0 }, {\r
+ speed: "fast",\r
complete: function() {\r
testStop();\r
}\r