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 * Slides the element
\r
21 * @description slides the element in 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 SlideInUp : function (speed,callback, easing)
\r
31 return this.queue('interfaceFX', function(){
\r
32 new jQuery.fx.slide(this, speed, callback, 'up', 'in', easing);
\r
38 * @description slides the element out up
\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 SlideOutUp : function (speed,callback, easing)
\r
48 return this.queue('interfaceFX', function(){
\r
49 new jQuery.fx.slide(this, speed, callback, 'up', 'out', easing);
\r
54 * @name SlideToggleUp
\r
55 * @description slides the element in/out up
\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 SlideToggleUp : function (speed,callback, easing)
\r
65 return this.queue('interfaceFX', function(){
\r
66 new jQuery.fx.slide(this, speed, callback, 'up', 'toggle', easing);
\r
72 * @description slides the element in down
\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 SlideInDown : function (speed,callback, easing)
\r
82 return this.queue('interfaceFX', function(){
\r
83 new jQuery.fx.slide(this, speed, callback, 'down', 'in', easing);
\r
88 * @name SlideOutDown
\r
89 * @description slides the element out down
\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 SlideOutDown : function (speed,callback, easing)
\r
99 return this.queue('interfaceFX', function(){
\r
100 new jQuery.fx.slide(this, speed, callback, 'down', 'out', easing);
\r
105 * @name SlideToggleDown
\r
106 * @description slides the element in/out down
\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 SlideToggleDown : function (speed,callback, easing)
\r
116 return this.queue('interfaceFX', function(){
\r
117 new jQuery.fx.slide(this, speed, callback, 'down', 'toggle', easing);
\r
122 * @name SlideInLeft
\r
123 * @description slides the element in left
\r
124 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
125 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
126 * @param String easing (optional) The name of the easing effect that you want to use.
\r
128 * @cat Plugins/Interface
\r
129 * @author Stefan Petre
\r
131 SlideInLeft : function (speed,callback, easing)
\r
133 return this.queue('interfaceFX', function(){
\r
134 new jQuery.fx.slide(this, speed, callback, 'left', 'in', easing);
\r
139 * @name SlideOutLeft
\r
140 * @description slides the element out left
\r
141 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
142 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
143 * @param String easing (optional) The name of the easing effect that you want to use.
\r
145 * @cat Plugins/Interface
\r
146 * @author Stefan Petre
\r
148 SlideOutLeft : function (speed,callback, easing)
\r
150 return this.queue('interfaceFX', function(){
\r
151 new jQuery.fx.slide(this, speed, callback, 'left', 'out', easing);
\r
156 * @name SlideToggleLeft
\r
157 * @description slides the element in/out left
\r
158 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
159 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
160 * @param String easing (optional) The name of the easing effect that you want to use.
\r
162 * @cat Plugins/Interface
\r
163 * @author Stefan Petre
\r
165 SlideToggleLeft : function (speed,callback, easing)
\r
167 return this.queue('interfaceFX', function(){
\r
168 new jQuery.fx.slide(this, speed, callback, 'left', 'toggle', easing);
\r
173 * @name SlideInRight
\r
174 * @description slides the element in right
\r
175 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
176 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
177 * @param String easing (optional) The name of the easing effect that you want to use.
\r
179 * @cat Plugins/Interface
\r
180 * @author Stefan Petre
\r
182 SlideInRight : function (speed,callback, easing)
\r
184 return this.queue('interfaceFX', function(){
\r
185 new jQuery.fx.slide(this, speed, callback, 'right', 'in', easing);
\r
190 * @name SlideOutRight
\r
191 * @description slides the element out right
\r
192 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
193 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
194 * @param String easing (optional) The name of the easing effect that you want to use.
\r
196 * @cat Plugins/Interface
\r
197 * @author Stefan Petre
\r
199 SlideOutRight : function (speed,callback, easing)
\r
201 return this.queue('interfaceFX', function(){
\r
202 new jQuery.fx.slide(this, speed, callback, 'right', 'out', easing);
\r
207 * @name SlideToggleRight
\r
208 * @description slides the element in/out right
\r
209 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
210 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
211 * @param String easing (optional) The name of the easing effect that you want to use.
\r
213 * @cat Plugins/Interface
\r
214 * @author Stefan Petre
\r
216 SlideToggleRight : function (speed,callback, easing)
\r
218 return this.queue('interfaceFX', function(){
\r
219 new jQuery.fx.slide(this, speed, callback, 'right', 'toggle', easing);
\r
225 jQuery.fx.slide = function(e, speed, callback, direction, type, easing)
\r
227 if (!jQuery.fxCheckTag(e)) {
\r
228 jQuery.dequeue(e, 'interfaceFX');
\r
233 z.easing = typeof callback == 'string' ? callback : easing||null;
\r
234 z.callback = typeof callback == 'function' ? callback : null;
\r
235 if ( type == 'toggle') {
\r
236 type = z.el.css('display') == 'none' ? 'in' : 'out';
\r
238 if (!e.ifxFirstDisplay)
\r
239 e.ifxFirstDisplay = z.el.css('display');
\r
243 z.fx = jQuery.fx.buildWrapper(e);
\r
246 z.direction = direction;
\r
247 z.complete = function()
\r
249 if(z.type == 'out')
\r
250 z.el.css('visibility', 'hidden');
\r
251 jQuery.fx.destroyWrapper(z.fx.wrapper.get(0), z.fx.oldStyle);
\r
252 if(z.type == 'in'){
\r
253 z.el.css('display', z.el.get(0).ifxFirstDisplay == 'none' ? 'block' : z.el.get(0).ifxFirstDisplay);
\r
255 z.el.css('display', 'none');
\r
256 z.el.css('visibility', 'visible');
\r
258 if (z.callback && z.callback.constructor == Function) {
\r
259 z.callback.apply(z.el.get(0));
\r
261 jQuery.dequeue(z.el.get(0), 'interfaceFX');
\r
263 switch (z.direction) {
\r
265 z.ef = new jQuery.fx(
\r
274 z.efx = new jQuery.fx(
\r
275 z.fx.wrapper.get(0),
\r
282 if (z.type == 'in') {
\r
283 z.ef.custom (-z.fx.oldStyle.sizes.hb, 0);
\r
284 z.efx.custom(0, z.fx.oldStyle.sizes.hb);
\r
286 z.ef.custom (0, -z.fx.oldStyle.sizes.hb);
\r
287 z.efx.custom (z.fx.oldStyle.sizes.hb, 0);
\r
291 z.ef = new jQuery.fx(
\r
300 if (z.type == 'in') {
\r
301 z.ef.custom (z.fx.oldStyle.sizes.hb, 0);
\r
303 z.ef.custom (0, z.fx.oldStyle.sizes.hb);
\r
307 z.ef = new jQuery.fx(
\r
316 z.efx = new jQuery.fx(
\r
317 z.fx.wrapper.get(0),
\r
324 if (z.type == 'in') {
\r
325 z.ef.custom (-z.fx.oldStyle.sizes.wb, 0);
\r
326 z.efx.custom (0, z.fx.oldStyle.sizes.wb);
\r
328 z.ef.custom (0, -z.fx.oldStyle.sizes.wb);
\r
329 z.efx.custom (z.fx.oldStyle.sizes.wb, 0);
\r
333 z.ef = new jQuery.fx(
\r
342 if (z.type == 'in') {
\r
343 z.ef.custom (z.fx.oldStyle.sizes.wb, 0);
\r
345 z.ef.custom (0, z.fx.oldStyle.sizes.wb);
\r