-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpartslideit.js
57 lines (42 loc) · 1.18 KB
/
partslideit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
PARTSLIDEIT - Partially Slide It
Ver.0.1
This is my first jQuery plugins. It partially slide your DIV childs from a container from top, bottom, left or right.
http://www.rosaimantoro.com/jqplugins/partslideit
*/
(function() {
$.fn.partslidit = function(options) {
var dcek = 0;
var sett = $.extend({
pos_start: 2000,
timing: 1000,
timeintv: 300, // timing interval beetwen div
direction: 'vertical' // vertical | horizontal
}, options );
return this.children(".slidit").each(function() {
endpos = $(this).offset();
if(sett.direction=='vertical') {
$(this).offset({ top: sett.pos_start, left: endpos.left});
//slide to the endpos
$(this).animate({
top: "" + (endpos.top - endpos.top) + ""
}
, sett.timing
, function() {
// complete
});
} else if(sett.direction=='horizontal') {
$(this).offset({ top: endpos.top, left: sett.pos_start});
//slide to the endpos
$(this).animate({
left: "" + (endpos.left - endpos.left) + ""
}
, sett.timing
, function() {
// complete
});
}
sett.timing += sett.timeintv;
});
}
}(jQuery));