jQuery.effects.createPlaceholder()

jQuery.effects.createPlaceholder()

jQuery.effects.createPlaceholder( element )Returns: jQueryversion added: 1.12

Description: Creates a placeholder to support 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.

If the original element is already absolutely positioned, no placeholder will be generated since the page layout isn't affected. As a result, the return value will be undefined.

© The jQuery Foundation and other contributors
Licensed under the MIT License.
https://api.jqueryui.com/jQuery.effects.createPlaceholder

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部