1 /*!2 * jQuery UI Effects Blind @VERSION3 *4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)5 * Dual licensed under the MIT or GPL Version 2 licenses.6 * http://jquery.org/license7 *8 * http://docs.jquery.com/UI/Effects/Blind9 *10 * Depends:11 * jquery.effects.core.js12 */13 (function( $, undefined ) {1415 $.effects.blind = function(o) {1617 return this.queue(function() {1819 // Create element20 var el = $(this), props = ['position','top','bottom','left','right'];2122 // Set options23 var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode24 var direction = o.options.direction || 'vertical'; // Default direction2526 // Adjust27 $.effects.save(el, props); el.show(); // Save & Show28 var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper29 var ref = (direction == 'vertical') ? 'height' : 'width';30 var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();31 if(mode == 'show') wrapper.css(ref, 0); // Shift3233 // Animation34 var animation = {};35 animation[ref] = mode == 'show' ? distance : 0;3637 // Animate38 wrapper.animate(animation, o.duration, o.options.easing, function() {39 if(mode == 'hide') el.hide(); // Hide40 $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore41 if(o.callback) o.callback.apply(el[0], arguments); // Callback42 el.dequeue();43 });4445 });4647 };4849 })(jQuery);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);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);
联系我们 |
---|
文章看不懂?联系我们为您免费解答!免费助力个人,小企站点! |
① 电话:020-2206-9892 |
② QQ咨询:1025174874 |
③ 邮件:info@361sale.com |
④ 工作时间:周一至周五,9:30-18:30,节假日休息 |
THE END
暂无评论内容