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

1 /*!
2 * jQuery UI Effects Drop @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/Drop
9 *
10 * Depends:
11 * jquery.effects.core.js
12 */
13 (function( $, undefined ) {
14
15 $.effects.drop = function(o) {
16
17 return this.queue(function() {
18
19 // Create element
20 var el = $(this), props = ['position','top','bottom','left','right','opacity'];
21
22 // Set options
23 var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
24 var direction = o.options.direction || 'left'; // Default Direction
25
26 // Adjust
27 $.effects.save(el, props); el.show(); // Save & Show
28 $.effects.createWrapper(el); // Create Wrapper
29 var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
30 var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
31 var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
32 if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
33
34 // Animation
35 var animation = {opacity: mode == 'show' ? 1 : 0};
36 animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
37
38 // Animate
39 el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
40 if(mode == 'hide') el.hide(); // Hide
41 $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
42 if(o.callback) o.callback.apply(this, arguments); // Callback
43 el.dequeue();
44 }});
45
46 });
47
48 };
49
50 })(jQuery);
1  /*!
2   * jQuery UI Effects Drop @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/Drop
9   *
10   * Depends:
11   *      jquery.effects.core.js
12   */
13  (function( $, undefined ) {
14  
15  $.effects.drop = function(o) {
16  
17          return this.queue(function() {
18  
19                  // Create element
20                  var el = $(this), props = ['position','top','bottom','left','right','opacity'];
21  
22                  // Set options
23                  var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
24                  var direction = o.options.direction || 'left'; // Default Direction
25  
26                  // Adjust
27                  $.effects.save(el, props); el.show(); // Save & Show
28                  $.effects.createWrapper(el); // Create Wrapper
29                  var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
30                  var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
31                  var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
32                  if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
33  
34                  // Animation
35                  var animation = {opacity: mode == 'show' ? 1 : 0};
36                  animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
37  
38                  // Animate
39                  el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
40                          if(mode == 'hide') el.hide(); // Hide
41                          $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
42                          if(o.callback) o.callback.apply(this, arguments); // Callback
43                          el.dequeue();
44                  }});
45  
46          });
47  
48  };
49  
50  })(jQuery);
1 /*! 2 * jQuery UI Effects Drop @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/Drop 9 * 10 * Depends: 11 * jquery.effects.core.js 12 */ 13 (function( $, undefined ) { 14 15 $.effects.drop = function(o) { 16 17 return this.queue(function() { 18 19 // Create element 20 var el = $(this), props = ['position','top','bottom','left','right','opacity']; 21 22 // Set options 23 var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode 24 var direction = o.options.direction || 'left'; // Default Direction 25 26 // Adjust 27 $.effects.save(el, props); el.show(); // Save & Show 28 $.effects.createWrapper(el); // Create Wrapper 29 var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; 30 var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; 31 var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2); 32 if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift 33 34 // Animation 35 var animation = {opacity: mode == 'show' ? 1 : 0}; 36 animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; 37 38 // Animate 39 el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { 40 if(mode == 'hide') el.hide(); // Hide 41 $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore 42 if(o.callback) o.callback.apply(this, arguments); // Callback 43 el.dequeue(); 44 }}); 45 46 }); 47 48 }; 49 50 })(jQuery);

联系我们
文章看不懂?联系我们为您免费解答!免费助力个人,小企站点!
电话:020-2206-9892
QQ咨询:1025174874
邮件:info@361sale.com
工作时间:周一至周五,9:30-18:30,节假日休息
© 转载声明
本文作者:Harry
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容