WordPress源代碼——jquery-ui(1.8.20——jquery.effects.blind.js)

1	/*!
2	 * jQuery UI Effects Blind @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/Blind
9	 *
10	 * Depends:
11	 *      jquery.effects.core.js
12	 */
13	(function( $, undefined ) {
14	
15	$.effects.blind = function(o) {
16	
17	        return this.queue(function() {
18	
19	                // Create element
20	                var el = $(this), props = ['position','top','bottom','left','right'];
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 ref = (direction == 'vertical') ? 'height' : 'width';
30	                var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();
31	                if(mode == 'show') wrapper.css(ref, 0); // Shift
32	
33	                // Animation
34	                var animation = {};
35	                animation[ref] = mode == 'show' ? distance : 0;
36	
37	                // Animate
38	                wrapper.animate(animation, o.duration, o.options.easing, function() {
39	                        if(mode == 'hide') el.hide(); // Hide
40	                        $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
41	                        if(o.callback) o.callback.apply(el[0], arguments); // Callback
42	                        el.dequeue();
43	                });
44	
45	        });
46	
47	};
48	
49	})(jQuery);

聯(lián)系我們
教程看不懂?聯(lián)系我們?yōu)槟赓M(fèi)解答!免費(fèi)助力個(gè)人,小企站點(diǎn)!
客服微信
客服微信
電話:020-2206-9892
QQ咨詢:1025174874
郵件:info@361sale.com
工作時(shí)間:周一至周五,9:30-18:30,節(jié)假日休息
? 轉(zhuǎn)載聲明
本文作者:Harry
THE END
喜歡就支持一下吧
點(diǎn)贊0 分享
評(píng)論 搶沙發(fā)

請(qǐng)登錄后發(fā)表評(píng)論

    暫無(wú)評(píng)論內(nèi)容