mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
effects.scale: fix: calculate top / left by outerHeight / Width. Fixed #6096 - effects.scale origin bottom bug
This commit is contained in:
parent
fe4ae30458
commit
7d232f7534
31
ui/jquery.effects.scale.js
vendored
31
ui/jquery.effects.scale.js
vendored
@ -54,7 +54,9 @@ $.effects.effect.scale = function( o ) {
|
|||||||
origin = o.origin,
|
origin = o.origin,
|
||||||
original = {
|
original = {
|
||||||
height: el.height(),
|
height: el.height(),
|
||||||
width: el.width()
|
width: el.width(),
|
||||||
|
outerHeight: el.outerHeight(),
|
||||||
|
outerWidth: el.outerWidth()
|
||||||
},
|
},
|
||||||
factor = {
|
factor = {
|
||||||
y: direction != 'horizontal' ? (percent / 100) : 1,
|
y: direction != 'horizontal' ? (percent / 100) : 1,
|
||||||
@ -74,7 +76,9 @@ $.effects.effect.scale = function( o ) {
|
|||||||
options.from = o.from || ( mode == 'show' ? { height: 0, width: 0 } : original );
|
options.from = o.from || ( mode == 'show' ? { height: 0, width: 0 } : original );
|
||||||
options.to = {
|
options.to = {
|
||||||
height: original.height * factor.y,
|
height: original.height * factor.y,
|
||||||
width: original.width * factor.x
|
width: original.width * factor.x,
|
||||||
|
outerHeight: original.outerHeight * factor.y,
|
||||||
|
outerWidth: original.outerWidth * factor.x
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( options.fade ) { // Fade option to support puff
|
if ( options.fade ) { // Fade option to support puff
|
||||||
@ -122,21 +126,14 @@ $.effects.effect.size = function( o ) {
|
|||||||
}
|
}
|
||||||
original = {
|
original = {
|
||||||
height: el.height(),
|
height: el.height(),
|
||||||
width: el.width()
|
width: el.width(),
|
||||||
|
outerHeight: el.outerHeight(),
|
||||||
|
outerWidth: el.outerWidth()
|
||||||
};
|
};
|
||||||
|
|
||||||
el.from = o.from || original;
|
el.from = o.from || original;
|
||||||
el.to = o.to || original;
|
el.to = o.to || original;
|
||||||
|
|
||||||
// Adjust
|
|
||||||
if (origin) { // Calculate baseline shifts
|
|
||||||
baseline = $.effects.getBaseline( origin, original );
|
|
||||||
el.from.top = ( original.height - el.from.height ) * baseline.y;
|
|
||||||
el.from.left = ( original.width - el.from.width ) * baseline.x;
|
|
||||||
el.to.top = ( original.height - el.to.height ) * baseline.y;
|
|
||||||
el.to.left = ( original.width - el.to.width ) * baseline.x;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set scaling factor
|
// Set scaling factor
|
||||||
factor = {
|
factor = {
|
||||||
from: {
|
from: {
|
||||||
@ -183,6 +180,16 @@ $.effects.effect.size = function( o ) {
|
|||||||
$.effects.createWrapper( el );
|
$.effects.createWrapper( el );
|
||||||
el.css( 'overflow', 'hidden' ).css( el.from );
|
el.css( 'overflow', 'hidden' ).css( el.from );
|
||||||
|
|
||||||
|
// Adjust
|
||||||
|
if (origin) { // Calculate baseline shifts
|
||||||
|
baseline = $.effects.getBaseline( origin, original );
|
||||||
|
el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
|
||||||
|
el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
|
||||||
|
el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
|
||||||
|
el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
|
||||||
|
}
|
||||||
|
el.css( el.from ); // set top & left
|
||||||
|
|
||||||
// Animate
|
// Animate
|
||||||
if ( scale == 'content' || scale == 'both' ) { // Scale the children
|
if ( scale == 'content' || scale == 'both' ) { // Scale the children
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user