.animate()
. The animationProperties
must contain a clip
property.This method is useful for mimicking a clip animation when using a placeholder for effects. Given a clip animation, jQuery.effects.clipToBox()
will generate an object containing top
, left
, width
, and height
properties which can be passed to .css()
or .animate()
. This method is generally used in conjunction with jQuery.effects.createPlaceholder()
.
clip
animations without disrupting the layout.Many effects require animating the clip
CSS property. In order to apply clipping, the element must be absolutely positioned. As a result, if an animation that utilizes clipping is applied to an element with static or relative positioning, the layout of the page will be affected when the animated element is removed from the flow. To compensate for this, a placeholder element with the same size and position can be inserted into the document.
jQuery.effects.createPlaceholder()
will create a placeholder with the same display, position, dimensions, and margins as the original element. The placeholder is inserted into the DOM as the next sibling of the original element. When the animation is complete, jQuery.effects.removePlaceholder()
should be used to remove the inserted element.
undefined
."show"
, "hide"
, or "toggle"
.options
argument contains duration
and mode
properties, as well as any effect-specific options.Defines a new effect for use with .effect()
, .show()
, .hide()
, and .toggle()
. The effect method is invoked with this
being a single DOM element. The done
argument must be invoked when the animation is complete.
jQuery.effects.define()
stores the new effect in jQuery.effects.effect[ name ]
and returns the function that was provided as the effect
parameter.
+ jQuery.effects.createPlaceholder()
.Removes the placeholder for an element. This method is safe to call even if jQuery.effects.createPlaceholder()
did not create a placeholder.
Restores all inline styles for an element which have been saved using jQuery.effects.saveStyle()
.
Stores a copy of the current inline styles applied to the element, which can be reapplied to the element later using jQuery.effects.restoreStyle()
. This is useful when animating various styles and restoring the existing styles at the end.
When using jQuery.effects.define()
to create an effect, if jQuery.effects.saveStyle()
is used on the main element being animated, the styles will be restored automatically when the animation is complete.
"horizontal"
or "vertical"
. If direction
is omitted, both dimensions will be scaled.This method scales the dimensions of an element, returning an object containing height
, width
, outerHeight
, and outerWidth
properties. The element is not actually modified.