-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.uplift.js
80 lines (52 loc) · 1.49 KB
/
jquery.uplift.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
This plugin can't be used in Non-Islamic activities.
Author: Muhammad Usman, Sylhet, Bangladesh
http://www.halalit.net
For Dcumentation: http://www.halalit.net/blog/archives/jquery-uplift-plugin
For Dem: http://www.halalit.net/ (see Testimonials section)
You can use or modify this script keeping this whole comment untouched.
*/
$.fn.uplift = function(opts) {
var defaults= {
timeout: 5000,
speed: 1000,
show: 2,
easing: 'easeInOutSine'
};
mee=$(this);
numm=mee.children().get();
slength=numm.length;
maxheight=0;
if (slength < 2) {
if (window.console && window.console.log)
window.console.log('terminating; too few slides: ' + slength);
return;
}
for(i=0;i<slength;i++) if($(numm[i]).height()>maxheight) maxheight=$(numm[i]).height();
for(i=0;i<slength;i++)
{
if( jQuery.trim($(numm[i]).html()) =='')
{
$(numm[i]).remove();
}else{
$(numm[i]).height(maxheight);
}
}
mee.height((maxheight*(opts.show)));
mee.css('overflow','hidden');
numm=mee.children().get();
slength=numm.length;
last=slength-1;
if(!$.browser.msie)
{
window.setInterval(function(){
numm=mee.children().get();
eend=$(numm[last]);
eend.height(0);
eend.css('opacity','0');
mee.prepend(eend);
eend.animate({height: maxheight,opacity: 1},opts.speed,opts.easing)
}, opts.timeout );
}
return mee;
}