From 1cc31644bd1ed1853c2b3e193e5c0d95be06634a Mon Sep 17 00:00:00 2001 From: Robin Rizvi Date: Thu, 18 Apr 2013 16:58:38 +0530 Subject: [PATCH] Updated jquery.prettyLoader.js Error - cur_x is not defined Cause - When the mouse is positioned at a place not belonging to the clientarea. The event parameter does not contain clientX and clientY properties, both are not defined and thus the PrettyLoader plugins throws an error at line#36 and line#37. Solution - TO correct this problem, I have added a simple condition that checks for such scenario. --- js/jquery.prettyLoader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/jquery.prettyLoader.js b/js/jquery.prettyLoader.js index 2494983..9152982 100644 --- a/js/jquery.prettyLoader.js +++ b/js/jquery.prettyLoader.js @@ -33,8 +33,8 @@ e = e ? e : window.event; // Set the cursor pos only if the even is returned by the browser. - cur_x = (e.clientX) ? e.clientX : cur_x; - cur_y = (e.clientY) ? e.clientY : cur_y; + cur_x = (e.clientX) ? e.clientX : (typeof cur_x==='undefined'?0:cur_x); + cur_y = (e.clientY) ? e.clientY : (typeof cur_y==='undefined'?0:cur_y); left_pos = cur_x + settings.offset_left + scrollPos['scrollLeft']; top_pos = cur_y + settings.offset_top + scrollPos['scrollTop']; @@ -104,4 +104,4 @@ return this; }; -})(jQuery); \ No newline at end of file +})(jQuery);