-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsocial.js
More file actions
40 lines (26 loc) · 716 Bytes
/
social.js
File metadata and controls
40 lines (26 loc) · 716 Bytes
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
define(["dojo", "dojo/fx/easing"], function(dojo, ease){
var d = dojo;
var defaults = {
top:-18
};
d.social = function(n, args){
n = d.byId(n);
var opts = d.mixin({}, defaults, args),
size = n.className.match(/size([0-9]+)/)[1]
;
switch(size){
case "24" : opts.top = -6; break;
case "32" : opts.top = -13; break;
}
d.query("li", n).forEach(function(n){
d.connect(n, "mouseenter", function(){
d.anim(n, { marginTop:opts.top }, 320, ease.backOut);
});
d.connect(n, "mouseleave", function(){
d.anim(n, { marginTop:0 }, 500, ease.bounceOut);
});
});
}
d.NodeList.prototype.social = d.NodeList._adaptAsForEach(d.social);
return d;
});