-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.fade-rollover.js
59 lines (51 loc) · 1.35 KB
/
jquery.fade-rollover.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
/*!
* jQuery Fade Rollover Plugin v2.2.0
* https://github.com/h2ham/jquery-fade-rollover.git
*
* Copyright 2014 Hiromu Hasegawa
* Released under the MIT license
*/
(function ( $ ) {
$.fn.opOver = function(op, oa, durationp, durationa){
var c = {
op : op ? op : 1.0,
oa : oa ? oa : 0.6,
durationp : durationp ? durationp : 'fast',
durationa : durationa ? durationa : 'fast'
};
$(this).each(function () {
$(this).css({
opacity : c.op,
filter : "alpha(opacity=" + c.op * 100 + ")"
}).hover(function(){
$(this).fadeTo(c.durationp, c.oa);
},function(){
$(this).fadeTo(c.durationa, c.op);
});
});
};
$.fn.wink = function (durationp, op, oa) {
var c = {
durationp : durationp ? durationp : 'slow',
op : op ? op : 1.0,
oa : oa ? oa : 0.2
};
$(this).each(function () {
$(this).css({
opacity : c.op,
filter : "alpha(opacity=" + c.op * 100 + ")"
}).hover(function () {
$(this).css({
opacity : c.oa,
filter : "alpha(opacity=" + c.oa * 100 + ")"
});
$(this).fadeTo(c.durationp, c.op);
}, function () {
$(this).css({
opacity : c.op,
filter : "alpha(opacity=" + c.op * 100 + ")"
});
});
});
};
})( jQuery );