Mercurial > hg > STI-GWT
comparison war/scripts/jQuery/ui/jquery.effects.slide.js @ 3:cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
git-svn-id: http://dev.dariah.eu/svn/repos/eu.dariah.de/ap1/sti-gwt-dariah-geobrowser@36 f2b5be40-def6-11e0-8a09-b3c1cc336c6b
author | StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b> |
---|---|
date | Tue, 17 Jul 2012 13:34:40 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2:2897af43ccc6 | 3:cf06b77a8bbd |
---|---|
1 /* | |
2 * jQuery UI Effects Slide 1.8.14 | |
3 * | |
4 * Copyright 2011, 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/Slide | |
9 * | |
10 * Depends: | |
11 * jquery.effects.core.js | |
12 */ | |
13 (function( $, undefined ) { | |
14 | |
15 $.effects.slide = function(o) { | |
16 | |
17 return this.queue(function() { | |
18 | |
19 // Create element | |
20 var el = $(this), props = ['position','top','bottom','left','right']; | |
21 | |
22 // Set options | |
23 var mode = $.effects.setMode(el, o.options.mode || 'show'); // 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).css({overflow:'hidden'}); // 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}) : el.outerWidth({margin:true})); | |
32 if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift | |
33 | |
34 // Animation | |
35 var animation = {}; | |
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); |