2 * Interface Elements for jQuery
\r
5 * http://interface.eyecon.ro
\r
7 * Copyright (c) 2006 Stefan Petre
\r
8 * Dual licensed under the MIT (MIT-LICENSE.txt)
\r
9 * and GPL (GPL-LICENSE.txt) licenses.
\r
15 * Applies a blinding animation to element
\r
21 * @description blinds the element up
\r
22 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
23 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
24 * @param String easing (optional) The name of the easing effect that you want to use.
\r
26 * @cat Plugins/Interface
\r
27 * @author Stefan Petre
\r
29 BlindUp : function (speed, callback, easing)
\r
31 return this.queue('interfaceFX',function(){
\r
32 new jQuery.fx.BlindDirection(this, speed, callback, 'up', easing);
\r
38 * @description blinds the element down
\r
39 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
40 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
41 * @param String easing (optional) The name of the easing effect that you want to use.
\r
43 * @cat Plugins/Interface
\r
44 * @author Stefan Petre
\r
46 BlindDown : function (speed, callback, easing)
\r
48 return this.queue('interfaceFX',function(){
\r
49 new jQuery.fx.BlindDirection(this, speed, callback, 'down', easing);
\r
54 * @name BlindToggleVertically
\r
55 * @description blinds the element up or down
\r
56 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
57 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
58 * @param String easing (optional) The name of the easing effect that you want to use.
\r
60 * @cat Plugins/Interface
\r
61 * @author Stefan Petre
\r
63 BlindToggleVertically : function (speed, callback, easing)
\r
65 return this.queue('interfaceFX',function(){
\r
66 new jQuery.fx.BlindDirection(this, speed, callback, 'togglever', easing);
\r
72 * @description blinds the element left
\r
73 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
74 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
75 * @param String easing (optional) The name of the easing effect that you want to use.
\r
77 * @cat Plugins/Interface
\r
78 * @author Stefan Petre
\r
80 BlindLeft : function (speed, callback, easing)
\r
82 return this.queue('interfaceFX',function(){
\r
83 new jQuery.fx.BlindDirection(this, speed, callback, 'left', easing);
\r
89 * @description blinds the element right
\r
90 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
91 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
92 * @param String easing (optional) The name of the easing effect that you want to use.
\r
94 * @cat Plugins/Interface
\r
95 * @author Stefan Petre
\r
97 BlindRight : function (speed, callback, easing)
\r
99 return this.queue('interfaceFX',function(){
\r
100 new jQuery.fx.BlindDirection(this, speed, callback, 'right', easing);
\r
105 * @name BlindToggleHorizontally
\r
106 * @description blinds the element left and right
\r
107 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
108 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
109 * @param String easing (optional) The name of the easing effect that you want to use.
\r
111 * @cat Plugins/Interface
\r
112 * @author Stefan Petre
\r
114 BlindToggleHorizontally : function (speed, callback, easing)
\r
116 return this.queue('interfaceFX',function(){
\r
117 new jQuery.fx.BlindDirection(this, speed, callback, 'togglehor', easing);
\r
123 jQuery.fx.BlindDirection = function (e, speed, callback, direction, easing)
\r
125 if (!jQuery.fxCheckTag(e)) {
\r
126 jQuery.dequeue(e, 'interfaceFX');
\r
131 z.size = jQuery.iUtil.getSize(e);
\r
132 z.easing = typeof callback == 'string' ? callback : easing||null;
\r
133 if (!e.ifxFirstDisplay)
\r
134 e.ifxFirstDisplay = z.el.css('display');
\r
135 if ( direction == 'togglever') {
\r
136 direction = z.el.css('display') == 'none' ? 'down' : 'up';
\r
137 } else if (direction == 'togglehor') {
\r
138 direction = z.el.css('display') == 'none' ? 'right' : 'left';
\r
142 z.callback = typeof callback == 'function' ? callback : null;
\r
143 z.fx = jQuery.fx.buildWrapper(e);
\r
144 z.direction = direction;
\r
145 z.complete = function()
\r
147 if (z.callback && z.callback.constructor == Function) {
\r
148 z.callback.apply(z.el.get(0));
\r
150 if(z.direction == 'down' || z.direction == 'right'){
\r
151 z.el.css('display', z.el.get(0).ifxFirstDisplay == 'none' ? 'block' : z.el.get(0).ifxFirstDisplay);
\r
155 jQuery.fx.destroyWrapper(z.fx.wrapper.get(0), z.fx.oldStyle);
\r
156 jQuery.dequeue(z.el.get(0), 'interfaceFX');
\r
158 switch (z.direction) {
\r
160 fxh = new jQuery.fx(
\r
161 z.fx.wrapper.get(0),
\r
169 fxh.custom(z.fx.oldStyle.sizes.hb, 0);
\r
172 z.fx.wrapper.css('height', '1px');
\r
174 fxh = new jQuery.fx(
\r
175 z.fx.wrapper.get(0),
\r
183 fxh.custom(0, z.fx.oldStyle.sizes.hb);
\r
186 fxh = new jQuery.fx(
\r
187 z.fx.wrapper.get(0),
\r
195 fxh.custom(z.fx.oldStyle.sizes.wb, 0);
\r
198 z.fx.wrapper.css('width', '1px');
\r
200 fxh = new jQuery.fx(
\r
201 z.fx.wrapper.get(0),
\r
209 fxh.custom(0, z.fx.oldStyle.sizes.wb);
\r