: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
x = origin[ 1 ] / original.width;
// Creates a placeholder element so that the original element can be made absolute
createPlaceholder: function( element ) {
cssPosition = element.css( "position" ),
position = element.position();
// Lock in margins first to account for form elements, which
// will change margin if you explicitly set height
// see: https://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
marginTop: element.css( "marginTop" ),
marginBottom: element.css( "marginBottom" ),
marginLeft: element.css( "marginLeft" ),
marginRight: element.css( "marginRight" )
.outerWidth( element.outerWidth() )
.outerHeight( element.outerHeight() );
if ( /^(static|relative)/.test( cssPosition ) ) {
cssPosition = "absolute";
placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( {
// Convert inline to inline block to account for inline elements
// that turn to inline block based on content (like img)
display: /^(inline|ruby)/.test( element.css( "display" ) ) ?
// Margins need to be set to account for margin collapse
marginTop: element.css( "marginTop" ),
marginBottom: element.css( "marginBottom" ),
marginLeft: element.css( "marginLeft" ),
marginRight: element.css( "marginRight" ),
"float": element.css( "float" )
.outerWidth( element.outerWidth() )
.outerHeight( element.outerHeight() )
.addClass( "ui-effects-placeholder" );
element.data( dataSpace + "placeholder", placeholder );
removePlaceholder: function( element ) {
var dataKey = dataSpace + "placeholder",
placeholder = element.data( dataKey );
element.removeData( dataKey );
// Removes a placeholder if it exists and restores
// properties that were modified during placeholder creation
cleanUp: function( element ) {
$.effects.restoreStyle( element );
$.effects.removePlaceholder( element );
setTransition: function( element, list, factor, value ) {
$.each( list, function( i, x ) {
var unit = element.cssUnit( x );
value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
// Return an effect options object for the given parameters:
function _normalizeArguments( effect, options, speed, callback ) {
// Allow passing all options as the first parameter
if ( $.isPlainObject( effect ) ) {
effect = { effect: effect };
// Catch (effect, null, ...)
// Catch (effect, callback)
if ( typeof options === "function" ) {
// Catch (effect, speed, ?)
if ( typeof options === "number" || $.fx.speeds[ options ] ) {
// Catch (effect, options, callback)
if ( typeof speed === "function" ) {
$.extend( effect, options );
speed = speed || options.duration;
effect.duration = $.fx.off ? 0 :
typeof speed === "number" ? speed :
speed in $.fx.speeds ? $.fx.speeds[ speed ] :
effect.complete = callback || options.complete;
function standardAnimationOption( option ) {
// Valid standard speeds (nothing, number, named speed)
if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
// Invalid strings - treat as "normal" speed
if ( typeof option === "string" && !$.effects.effect[ option ] ) {
if ( typeof option === "function" ) {
// Options hash (but not naming an effect)
if ( typeof option === "object" && !option.effect ) {
// Didn't match any standard API
effect: function( /* effect, options, speed, callback */ ) {
var args = _normalizeArguments.apply( this, arguments ),
effectMethod = $.effects.effect[ args.effect ],
defaultMode = effectMethod.mode,
queueName = queue || "fx",
complete = args.complete,
prefilter = function( next ) {
normalizedMode = $.effects.mode( el, mode ) || defaultMode;
// Sentinel for duck-punching the :animated pseudo-selector
el.data( dataSpaceAnimated, true );
// Save effect mode for later use,
// we can't just call $.effects.mode again later,
// as the .show() below destroys the initial state
modes.push( normalizedMode );
// See $.uiBackCompat inside of run() for removal of defaultMode in 1.14
if ( defaultMode && ( normalizedMode === "show" ||
( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) {
if ( !defaultMode || normalizedMode !== "none" ) {
$.effects.saveStyle( el );
if ( typeof next === "function" ) {
if ( $.fx.off || !effectMethod ) {
// Delegate to the original method (e.g., .show()) if possible
return this[ mode ]( args.duration, complete );
return this.each( function() {
elem.removeData( dataSpaceAnimated );
$.effects.cleanUp( elem );
if ( args.mode === "hide" ) {
if ( typeof complete === "function" ) {
complete.call( elem[ 0 ] );
if ( typeof next === "function" ) {
// Override mode option on a per element basis,
// as toggle can be either show or hide depending on element state
args.mode = modes.shift();
if ( $.uiBackCompat !== false && !defaultMode ) {
if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
// Call the core method to track "olddisplay" properly
effectMethod.call( elem[ 0 ], args, done );
if ( args.mode === "none" ) {
// Call the core method to track "olddisplay" properly
effectMethod.call( elem[ 0 ], args, cleanup );
// Run prefilter on all elements first to ensure that
// any showing or hiding happens before placeholder creation,
// which ensures that any layout changes are correctly captured.
this.each( prefilter ).each( run ) :
this.queue( queueName, prefilter ).queue( queueName, run );
show: ( function( orig ) {
return function( option ) {
if ( standardAnimationOption( option ) ) {
return orig.apply( this, arguments );
var args = _normalizeArguments.apply( this, arguments );
return this.effect.call( this, args );
hide: ( function( orig ) {
return function( option ) {
if ( standardAnimationOption( option ) ) {
return orig.apply( this, arguments );
var args = _normalizeArguments.apply( this, arguments );
return this.effect.call( this, args );
toggle: ( function( orig ) {
return function( option ) {
if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
return orig.apply( this, arguments );
var args = _normalizeArguments.apply( this, arguments );
return this.effect.call( this, args );
cssUnit: function( key ) {
var style = this.css( key ),
$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
if ( style.indexOf( unit ) > 0 ) {
val = [ parseFloat( style ), unit ];
cssClip: function( clipObj ) {
return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " +
clipObj.bottom + "px " + clipObj.left + "px)" );
return parseClip( this.css( "clip" ), this );
transfer: function( options, done ) {
target = $( options.to ),
targetFixed = target.css( "position" ) === "fixed",
fixTop = targetFixed ? body.scrollTop() : 0,
fixLeft = targetFixed ? body.scrollLeft() : 0,
endPosition = target.offset(),
top: endPosition.top - fixTop,
left: endPosition.left - fixLeft,
height: target.innerHeight(),
width: target.innerWidth()
startPosition = element.offset(),
transfer = $( "<div class='ui-effects-transfer'></div>" );
.addClass( options.className )
top: startPosition.top - fixTop,
left: startPosition.left - fixLeft,
height: element.innerHeight(),
width: element.innerWidth(),
position: targetFixed ? "fixed" : "absolute"
.animate( animation, options.duration, options.easing, function() {
if ( typeof done === "function" ) {
function parseClip( str, element ) {
var outerWidth = element.outerWidth(),
outerHeight = element.outerHeight(),
clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ];
top: parseFloat( values[ 1 ] ) || 0,
right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ),
bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ),
left: parseFloat( values[ 4 ] ) || 0
$.fx.step.clip = function( fx ) {
fx.start = $( fx.elem ).cssClip();
if ( typeof fx.end === "string" ) {
fx.end = parseClip( fx.end, fx.elem );
top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top,
right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right,
bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom,
left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left
/******************************************************************************/
/*********************************** EASING ***********************************/
/******************************************************************************/
// Based on easing equations from Robert Penner (http://robertpenner.com/easing)
$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
baseEasings[ name ] = function( p ) {
return Math.pow( p, i + 2 );
return 1 - Math.cos( p * Math.PI / 2 );
return 1 - Math.sqrt( 1 - p * p );
return p === 0 || p === 1 ? p :
-Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 );
return p * p * ( 3 * p - 2 );
while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
$.each( baseEasings, function( name, easeIn ) {
$.easing[ "easeIn" + name ] = easeIn;
$.easing[ "easeOut" + name ] = function( p ) {
return 1 - easeIn( 1 - p );
$.easing[ "easeInOut" + name ] = function( p ) {
1 - easeIn( p * -2 + 2 ) / 2;