Team:Shenzhen BGIC ATCG/front.html
From 2013.igem.org
(Difference between revisions)
Line 80: | Line 80: | ||
top: 585 | top: 585 | ||
}, | }, | ||
- | + | radius2 = 20; | |
+ | radius1 = 15; | ||
var setEyeOffset = function(event) { | var setEyeOffset = function(event) { | ||
var offset = $(".eye_wrapper").offset(); | var offset = $(".eye_wrapper").offset(); | ||
Line 93: | Line 94: | ||
var m2 = -(event.clientY - y2); | var m2 = -(event.clientY - y2); | ||
var k2 = Math.atan2(m2, n2); | var k2 = Math.atan2(m2, n2); | ||
- | var x11 = (Math.cos(k1) * | + | var x11 = (Math.cos(k1) * radius1 + x1).toFixed(0); |
- | var y11 = (( - Math.sin(k1) * | + | var y11 = (( - Math.sin(k1) * radius2) + y1).toFixed(0); |
$(".eye-left").offset({ | $(".eye-left").offset({ | ||
left: x11, | left: x11, | ||
top: y11 | top: y11 | ||
}); | }); | ||
- | var x22 = (Math.cos(k2) * | + | var x22 = (Math.cos(k2) * radius2 + x2).toFixed(0); |
- | var y22 = (( - Math.sin(k2) * | + | var y22 = (( - Math.sin(k2) * radius2) + y2).toFixed(0); |
$(".eye-right").offset({ | $(".eye-right").offset({ | ||
left: x22, | left: x22, |
Revision as of 15:23, 13 September 2013