These effect methods may be used to perform animations on DOM elements.

">
立诚勿怠,格物致知
It's all about connecting the dots

Effect methods in jQuery

注:本文内容摘录自《Learning jQuery (4th Edition)》。

These effect methods may be used to perform animations on DOM elements.

Predefined effects

Predefined effects
Effect method Description
.show() Displays the matched elements.
.hide() Hides the matched elements.
.show(speed, [callback]) Dispalys the matched elements by animating height, width, and opacity.
.hide(speed, [callback]) Hides the matched elements by animating height, width, an opacity.
.toggle([speed], [callback]) Displays or hides the matched elements.
.slideDown([speed],[callback]) Displays the matched elements with a sliding motion.
.slideUp([speed], [callback]) Hides the matched elements with a sliding motion.
.fadeIn([speed], [callback]) Displays the matched elements by fading them to opaque.
.fadeOut([speed], [callback]) Hides the matched elements by fading them to transparent.
.fadeToogle([speed], [callback]) Displays or hides the matched elements with a fading animation.
.fadeTo(speed, opacity, [callback]) Adjusts the opacity of the matched elements.

Custom animations

Custom animations
Effect method Description
.animate(properties, [speed], [easing], [callback]) Performs a custom animation of the specified CSS properties.
.animate(properties, options) A lower-level interface to .animate(), allowing control over the animation queue.

Queue manipulation

Queue manipulation
Effect method Description
.queue([queueName]) Retrieves the queue of functions on the first matched element.
.queue([queueName], callback) Adds callback to the end of the queue.
.queue([queueName], newQueue) Replaces the queue with a new one.
.dequeue([queueName]) Executes the next function on the queue.
.clearQueue([queueName]) Empties the queue of all pending functions.
.stop([clearQueue], [jumpToEnd]) Stops the curently running animation, then starts queued animations, if any.
.finish([queueName]) Stops the currently running animation and immediately advances all queued animations to their target values.
.delay(duration, [queueName]) Waits duration milliseconds before executing the next item in the queue.
.promise([queueName], [target]) Returns a promise object to be resolved once all queued actions on the collection have finished.
赞(0) 打赏
文章名称:《Effect methods in jQuery》
文章链接:https://www.orzzone.com/effect-methods-in-jquery.html
商业联系:yakima.public@gmail.com

本站大部分文章为原创或编译而来,对于本站版权文章,未经许可不得用于商业目的,非商业性转载请以链接形式标注原文出处。
本站内容仅供个人学习交流,不做为任何投资、建议的参考依据,因此产生的问题需自行承担。

评论 抢沙发

大前端WordPress主题 更专业 更方便

支持快讯、专题、百度收录推送、人机验证、多级分类筛选器,适用于垂直站点、科技博客、个人站,扁平化设计、简洁白色、超多功能配置、会员中心、直达链接、文章图片弹窗、自动缩略图等...

去看看

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力提供更多优质内容!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册