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 folding animation to element
\r
21 * @description folds the element
\r
22 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
23 * @param Integer height the height in pixels to fold element to
\r
24 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
25 * @param String easing (optional) The name of the easing effect that you want to use.
\r
27 * @cat Plugins/Interface
\r
28 * @author Stefan Petre
\r
30 Fold : function (speed, height, callback, easing)
\r
32 return this.queue('interfaceFX',function(){
\r
33 new jQuery.fx.DoFold(this, speed, height, callback, 'fold', easing);
\r
39 * @description unfolds the element
\r
40 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
41 * @param Integer height the height in pixels to unfold element to
\r
42 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
43 * @param String easing (optional) The name of the easing effect that you want to use.
\r
45 * @cat Plugins/Interface
\r
46 * @author Stefan Petre
\r
48 UnFold : function (speed, height, callback, easing)
\r
50 return this.queue('interfaceFX',function(){
\r
51 new jQuery.fx.DoFold(this, speed, height, callback, 'unfold', easing);
\r
57 * @description folds/unfolds the element
\r
58 * @param Mixed speed animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
\r
59 * @param Integer height the height in pixels to folds/unfolds element to
\r
60 * @param Function callback (optional) A function to be executed whenever the animation completes.
\r
61 * @param String easing (optional) The name of the easing effect that you want to use.
\r
63 * @cat Plugins/Interface
\r
64 * @author Stefan Petre
\r
66 FoldToggle : function (speed, height, callback, easing)
\r
68 return this.queue('interfaceFX',function(){
\r
69 new jQuery.fx.DoFold(this, speed, height, callback, 'toggle', easing);
\r
75 jQuery.fx.DoFold = function (e, speed, height, callback, type, easing)
\r
77 if (!jQuery.fxCheckTag(e)) {
\r
78 jQuery.dequeue(e, 'interfaceFX');
\r
83 z.easing = typeof callback == 'string' ? callback : easing||null;
\r
84 z.callback = typeof callback == 'function' ? callback : null;
\r
85 if ( type == 'toggle') {
\r
86 type = z.el.css('display') == 'none' ? 'unfold' : 'fold';
\r
90 z.height = height && height.constructor == Number ? height : 20;
\r
91 z.fx = jQuery.fx.buildWrapper(e);
\r
93 z.complete = function()
\r
95 if (z.callback && z.callback.constructor == Function) {
\r
96 z.callback.apply(z.el.get(0));
\r
98 if(z.type == 'unfold'){
\r
103 jQuery.fx.destroyWrapper(z.fx.wrapper.get(0), z.fx.oldStyle);
\r
104 jQuery.dequeue(z.el.get(0), 'interfaceFX');
\r
106 if ( z.type == 'unfold') {
\r
108 z.fx.wrapper.css('height', z.height + 'px').css('width', '1px');
\r
110 z.ef = new jQuery.fx(
\r
111 z.fx.wrapper.get(0),
\r
117 z.ef = new jQuery.fx(
\r
118 z.fx.wrapper.get(0),
\r
126 z.ef.custom(z.height, z.fx.oldStyle.sizes.hb);
\r
131 z.ef.custom(0, z.fx.oldStyle.sizes.wb);
\r
133 z.ef = new jQuery.fx(
\r
134 z.fx.wrapper.get(0),
\r
140 z.ef = new jQuery.fx(
\r
141 z.fx.wrapper.get(0),
\r
149 z.ef.custom(z.fx.oldStyle.sizes.wb, 0);
\r
154 z.ef.custom(z.fx.oldStyle.sizes.hb, z.height);
\r