]> source.dussan.org Git - jquery-ui.git/commitdiff
Effects: Added support for effects on elements with right and/or bottom style settings.
authorScott González <scott.gonzalez@gmail.com>
Tue, 10 Nov 2009 16:16:52 +0000 (16:16 +0000)
committerScott González <scott.gonzalez@gmail.com>
Tue, 10 Nov 2009 16:16:52 +0000 (16:16 +0000)
Fixes #4540 - Fix bug effect for IE7. In create wrapper function.

ui/jquery.effects.core.js

index 96eb44a4c7f5c72b242e9a2435ffdb9efce7f654..90ae82abb6bdd831d9989c031263c3bdd692c9b1 100644 (file)
@@ -343,11 +343,19 @@ $.extend($.effects, {
                //Transfer the positioning of the element to the wrapper
                if (element.css('position') == 'static') {
                        wrapper.css({ position: 'relative' });
-                       element.css({ position: 'relative');
+                       element.css({ position: 'relative' });
                } else {
-                       var top = element.css('top'); if(isNaN(parseInt(top,10))) top = 'auto';
-                       var left = element.css('left'); if(isNaN(parseInt(left,10))) left = 'auto';
-                       wrapper.css({ position: element.css('position'), top: top, left: left, zIndex: element.css('z-index') }).show();
+                       var cssProps = {
+                               position: element.css('position'),
+                               zIndex: element.css('z-index')
+                       };
+                       $.each(['top', 'left', 'bottom', 'right'], function(i, pos) {
+                               cssProps[pos] = element.css(pos);
+                               if (isNaN(parseInt(cssProps[pos], 10))) {
+                                       cssProps[pos] = 'auto';
+                               }
+                       });
+                       wrapper.css(cssProps).show();
                        element.css({position: 'relative', top: 0, left: 0 });
                }