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 dropping effect to element
\r
21 * @description drops the element out down
\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 DropOutDown : function (speed, callback, easing) {
\r
30 return this.queue('interfaceFX',function(){
\r
31 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'down', 'out', easing);
\r
37 * @description drops the element in down
\r
38 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
39 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
40 * @param String easing (optional) The name of the easing effect that you want to use.
\r
42 * @cat Plugins/Interface
\r
43 * @author Stefan Petre
\r
45 DropInDown : function (speed, callback, easing) {
\r
46 return this.queue('interfaceFX',function(){
\r
47 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'down', 'in', easing);
\r
52 * @name DropToggleDown
\r
53 * @description drops the element in/out down
\r
54 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
55 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
56 * @param String easing (optional) The name of the easing effect that you want to use.
\r
58 * @cat Plugins/Interface
\r
59 * @author Stefan Petre
\r
61 DropToggleDown : function (speed, callback, easing) {
\r
62 return this.queue('interfaceFX',function(){
\r
63 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'down', 'toggle', easing);
\r
69 * @description drops the element out up
\r
70 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
71 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
72 * @param String easing (optional) The name of the easing effect that you want to use.
\r
74 * @cat Plugins/Interface
\r
75 * @author Stefan Petre
\r
77 DropOutUp : function (speed, callback, easing) {
\r
78 return this.queue('interfaceFX',function(){
\r
79 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'up', 'out', easing);
\r
85 * @description drops the element in up
\r
86 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
87 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
88 * @param String easing (optional) The name of the easing effect that you want to use.
\r
90 * @cat Plugins/Interface
\r
91 * @author Stefan Petre
\r
93 DropInUp : function (speed, callback, easing) {
\r
94 return this.queue('interfaceFX',function(){
\r
95 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'up', 'in', easing);
\r
100 * @name DropToggleUp
\r
101 * @description drops the element in/out up
\r
102 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
103 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
104 * @param String easing (optional) The name of the easing effect that you want to use.
\r
106 * @cat Plugins/Interface
\r
107 * @author Stefan Petre
\r
109 DropToggleUp : function (speed, callback, easing) {
\r
110 return this.queue('interfaceFX',function(){
\r
111 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'up', 'toggle', easing);
\r
116 * @name DropOutLeft
\r
117 * @description drops the element out left
\r
118 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
119 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
120 * @param String easing (optional) The name of the easing effect that you want to use.
\r
122 * @cat Plugins/Interface
\r
123 * @author Stefan Petre
\r
125 DropOutLeft : function (speed, callback, easing) {
\r
126 return this.queue('interfaceFX',function(){
\r
127 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'left', 'out', easing);
\r
133 * @description drops the element in left
\r
134 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
135 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
136 * @param String easing (optional) The name of the easing effect that you want to use.
\r
138 * @cat Plugins/Interface
\r
139 * @author Stefan Petre
\r
141 DropInLeft : function (speed, callback, easing) {
\r
142 return this.queue('interfaceFX',function(){
\r
143 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'left', 'in', easing);
\r
148 * @name DropToggleLeft
\r
149 * @description drops the element in/out left
\r
150 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
151 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
152 * @param String easing (optional) The name of the easing effect that you want to use.
\r
154 * @cat Plugins/Interface
\r
155 * @author Stefan Petre
\r
157 DropToggleLeft : function (speed, callback, easing) {
\r
158 return this.queue('interfaceFX',function(){
\r
159 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'left', 'toggle', easing);
\r
164 * @name DropOutRight
\r
165 * @description drops the element out right
\r
166 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
167 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
168 * @param String easing (optional) The name of the easing effect that you want to use.
\r
170 * @cat Plugins/Interface
\r
171 * @author Stefan Petre
\r
173 DropOutRight : function (speed, callback, easing) {
\r
174 return this.queue('interfaceFX',function(){
\r
175 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'right', 'out', easing);
\r
180 * @name DropInRight
\r
181 * @description drops the element in right
\r
182 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
183 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
184 * @param String easing (optional) The name of the easing effect that you want to use.
\r
186 * @cat Plugins/Interface
\r
187 * @author Stefan Petre
\r
189 DropInRight : function (speed, callback, easing) {
\r
190 return this.queue('interfaceFX',function(){
\r
191 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'right', 'in', easing);
\r
196 * @name DropToggleRight
\r
197 * @description drops the element in/out right
\r
198 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
199 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
200 * @param String easing (optional) The name of the easing effect that you want to use.
\r
202 * @cat Plugins/Interface
\r
203 * @author Stefan Petre
\r
205 DropToggleRight : function (speed, callback, easing) {
\r
206 return this.queue('interfaceFX',function(){
\r
207 new jQuery.fx.DropOutDirectiont(this, speed, callback, 'right', 'toggle', easing);
\r
213 jQuery.fx.DropOutDirectiont = function (e, speed, callback, direction, type, easing)
\r
215 if (!jQuery.fxCheckTag(e)) {
\r
216 jQuery.dequeue(e, 'interfaceFX');
\r
221 z.easing = typeof callback == 'string' ? callback : easing||null;
\r
223 z.oldStyle.position = z.el.css('position');
\r
224 z.oldStyle.top = z.el.css('top');
\r
225 z.oldStyle.left = z.el.css('left');
\r
226 if (!e.ifxFirstDisplay)
\r
227 e.ifxFirstDisplay = z.el.css('display');
\r
228 if ( type == 'toggle') {
\r
229 type = z.el.css('display') == 'none' ? 'in' : 'out';
\r
233 if (z.oldStyle.position != 'relative' && z.oldStyle.position != 'absolute') {
\r
234 z.el.css('position', 'relative');
\r
237 callback = typeof callback == 'function' ? callback : null;
\r
238 /*sizes = ['em','px','pt','%'];
\r
240 if (z.oldStyle.top.indexOf(sizes[i])>0) {
\r
241 z.topUnit = sizes[1];
\r
242 z.topSize = parseFloat(z.oldStyle.top)||0;
\r
244 if (z.oldStyle.left.indexOf(sizes[i])>0) {
\r
245 z.leftUnit = sizes[1];
\r
246 z.leftSize = parseFloat(z.oldStyle.left)||0;
\r
250 directionIncrement = 1;
\r
251 switch (direction){
\r
253 z.e = new jQuery.fx(z.el.get(0), jQuery.speed(speed - 15, z.easing,callback), 'top');
\r
254 z.point = parseFloat(z.oldStyle.top)||0;
\r
255 z.unit = z.topUnit;
\r
256 directionIncrement = -1;
\r
259 z.e = new jQuery.fx(z.el.get(0), jQuery.speed(speed - 15, z.easing,callback), 'top');
\r
260 z.point = parseFloat(z.oldStyle.top)||0;
\r
261 z.unit = z.topUnit;
\r
264 z.e = new jQuery.fx(z.el.get(0), jQuery.speed(speed - 15, z.easing,callback), 'left');
\r
265 z.point = parseFloat(z.oldStyle.left)||0;
\r
266 z.unit = z.leftUnit;
\r
269 z.e = new jQuery.fx(z.el.get(0), jQuery.speed(speed - 15, z.easing,callback), 'left');
\r
270 z.point = parseFloat(z.oldStyle.left)||0;
\r
271 z.unit = z.leftUnit;
\r
272 directionIncrement = -1;
\r
275 z.e2 = new jQuery.fx(
\r
282 z.el.css(z.oldStyle);
\r
283 if (z.type == 'out') {
\r
284 z.el.css('display', 'none');
\r
286 z.el.css('display', z.el.get(0).ifxFirstDisplay == 'none' ? 'block' : z.el.get(0).ifxFirstDisplay);
\r
288 jQuery.dequeue(z.el.get(0), 'interfaceFX');
\r
293 if (type == 'in') {
\r
294 z.e.custom(z.point+ 100*directionIncrement, z.point);
\r
297 z.e.custom(z.point, z.point + 100*directionIncrement);
\r