Skip to content

effects: Fix for margin:auto(#4228); create wrapper with width:100% #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ui/jquery.effects.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,12 @@ $.extend( $.effects, {
}

// wrap the element
var props = {
width: element.outerWidth(true),
var floating = element.css( "float" ),
props = {
// for margin #px auto;(horizontal center)
width: floating === "none" ? "100%" : element.outerWidth(true),
height: element.outerHeight(true),
"float": element.css( "float" )
"float": floating
},
wrapper = $( "<div></div>" )
.addClass( "ui-effects-wrapper" )
Expand Down
9 changes: 5 additions & 4 deletions ui/jquery.effects.slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ $.effects.effect.slide = function( o ) {
ref = (direction == 'up' || direction == 'down') ? 'top' : 'left',
motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg',
distance,
animation = {};
animation = {}, wrapper;

// Adjust
$.effects.save( el, props );
el.show();
$.effects.createWrapper( el ).css({
wrapper = $.effects.createWrapper( el ).css({
overflow: 'hidden'
});

distance = o.distance || el[ ref == 'top' ? "outerHeight" : "outerWidth" ]({

// use the wrapper size, since it differs according to the block margin
distance = o.distance || wrapper[ ref == 'top' ? "outerHeight" : "outerWidth" ]({
margin: true
});
if (mode == 'show') {
Expand Down