WordPress源代码——jquery-ui(1.8.20——jquery.effects.clip.js)

1	/*!
2	 * jQuery UI Effects Clip @VERSION
3	 *
4	 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5	 * Dual licensed under the MIT or GPL Version 2 licenses.
6	 * http://jquery.org/license
7	 *
8	 * http://docs.jquery.com/UI/Effects/Clip
9	 *
10	 * Depends:
11	 *      jquery.effects.core.js
12	 */
13	(function( $, undefined ) {
14	
15	$.effects.clip = function(o) {
16	
17	        return this.queue(function() {
18	
19	                // Create element
20	                var el = $(this), props = ['position','top','bottom','left','right','height','width'];
21	
22	                // Set options
23	                var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
24	                var direction = o.options.direction || 'vertical'; // Default direction
25	
26	                // Adjust
27	                $.effects.save(el, props); el.show(); // Save & Show
28	                var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
29	                var animate = el[0].tagName == 'IMG' ? wrapper : el;
30	                var ref = {
31	                        size: (direction == 'vertical') ? 'height' : 'width',
32	                        position: (direction == 'vertical') ? 'top' : 'left'
33	                };
34	                var distance = (direction == 'vertical') ? animate.height() : animate.width();
35	                if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift
36	
37	                // Animation
38	                var animation = {};
39	                animation[ref.size] = mode == 'show' ? distance : 0;
40	                animation[ref.position] = mode == 'show' ? 0 : distance / 2;
41	
42	                // Animate
43	                animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
44	                        if(mode == 'hide') el.hide(); // Hide
45	                        $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
46	                        if(o.callback) o.callback.apply(el[0], arguments); // Callback
47	                        el.dequeue();
48	                }});
49	
50	        });
51	
52	};
53	
54	})(jQuery);

联系我们
文章看不懂?联系我们为您免费解答!免费助力个人,小企站点!
电话:020-2206-9892
QQ咨询:1025174874
邮件:info@361sale.com
工作时间:周一至周五,9:30-18:30,节假日休息
发布者:光子波动,转转请注明出处:https://www.361sale.com/12635/

(0)
上一篇 2024年 7月 5日 上午11:21
下一篇 2024年 7月 5日 上午11:28

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

联系我们

020-2206-9892

QQ咨询:1025174874

邮件:info@361sale.com

工作时间:周一至周五,9:30-18:30,节假日休息

客服微信
为方便全球用户注册登录,我们已取消电话登录功能。如遇登录问题,请联系客服协助绑定邮箱。