From: Scott González Date: Tue, 10 Nov 2009 16:16:52 +0000 (+0000) Subject: Effects: Added support for effects on elements with right and/or bottom style settings. X-Git-Tag: 1.8a2~43 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cbbac604ff93345aef7eeabbe864fddfca802c12;p=jquery-ui.git Effects: Added support for effects on elements with right and/or bottom style settings. Fixes #4540 - Fix bug effect for IE7. In create wrapper function. --- diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index 96eb44a4c..90ae82abb 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -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 }); }