From d45adcf0b968e74cb27b8038f227998cbf4137ee Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 24 Sep 2013 20:41:18 +0000 Subject: fix switchbox for deeply nested position absolute elements (should use position() instead of offset()) git-svn-id: http://piwigo.org/svn/trunk@24612 68402e56-0260-453c-a942-63ccdbb3a9ee --- themes/default/js/switchbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'themes/default') diff --git a/themes/default/js/switchbox.js b/themes/default/js/switchbox.js index 4741e7980..b20f82d50 100644 --- a/themes/default/js/switchbox.js +++ b/themes/default/js/switchbox.js @@ -2,8 +2,8 @@ var sbFunc = function(link, box) { jQuery(link).click(function() { var elt = jQuery(box); - elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5)) - .css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true)) + elt.css("left", Math.min( jQuery(this).position().left, jQuery(window).width() - elt.outerWidth(true) - 5)) + .css("top", jQuery(this).position().top + jQuery(this).outerHeight(true)) .toggle(); return false; }); -- cgit v1.2.3