1 |
503b3f7b
|
Assos Assos
|
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
(function( $, undefined ) {
|
15 |
|
|
|
16 |
|
|
$.effects.effect.slide = function( o, done ) {
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
var el = $( this ),
|
20 |
|
|
props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
|
21 |
|
|
mode = $.effects.setMode( el, o.mode || "show" ),
|
22 |
|
|
show = mode === "show",
|
23 |
|
|
direction = o.direction || "left",
|
24 |
|
|
ref = (direction === "up" || direction === "down") ? "top" : "left",
|
25 |
|
|
positiveMotion = (direction === "up" || direction === "left"),
|
26 |
|
|
distance,
|
27 |
|
|
animation = {};
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
$.effects.save( el, props );
|
31 |
|
|
el.show();
|
32 |
|
|
distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
|
33 |
|
|
|
34 |
|
|
$.effects.createWrapper( el ).css({
|
35 |
|
|
overflow: "hidden"
|
36 |
|
|
});
|
37 |
|
|
|
38 |
|
|
if ( show ) {
|
39 |
|
|
el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
|
40 |
|
|
}
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
animation[ ref ] = ( show ?
|
44 |
|
|
( positiveMotion ? "+=" : "-=") :
|
45 |
|
|
( positiveMotion ? "-=" : "+=")) +
|
46 |
|
|
distance;
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
el.animate( animation, {
|
50 |
|
|
queue: false,
|
51 |
|
|
duration: o.duration,
|
52 |
|
|
easing: o.easing,
|
53 |
|
|
complete: function() {
|
54 |
|
|
if ( mode === "hide" ) {
|
55 |
|
|
el.hide();
|
56 |
|
|
}
|
57 |
|
|
$.effects.restore( el, props );
|
58 |
|
|
$.effects.removeWrapper( el );
|
59 |
|
|
done();
|
60 |
|
|
}
|
61 |
|
|
});
|
62 |
|
|
};
|
63 |
|
|
|
64 |
|
|
})(jQuery); |