Team:StuyGem NYC
From 2014hs.igem.org
(Difference between revisions)
Kelvinn1996 (Talk | contribs) |
Kelvinn1996 (Talk | contribs) |
||
Line 205: | Line 205: | ||
} | } | ||
- | + | canvas.addEventListener('mousemove', function(evt){ | |
+ | var mousePos = getMousePos(canvas, evt); | ||
+ | if ((mousePos.x < 250) && (mousePos.y < 250)) { | ||
+ | imageObj.src = 'img/teamOn.png'; | ||
+ | imageObj2.src = 'img/parts.png'; | ||
+ | imageObj3.src = 'img/sponsors.png'; | ||
+ | imageObj4.src = 'img/Project.png'; | ||
+ | } | ||
+ | else if ((mousePos.x < 250) && (mousePos.y >= 250)) { | ||
+ | imageObj.src = 'img/team.png'; | ||
+ | imageObj2.src = 'img/partsOn.png'; | ||
+ | imageObj3.src = 'img/sponsors.png'; | ||
+ | imageObj4.src = 'img/Project.png'; | ||
+ | } | ||
+ | else if ((mousePos.x >= 250) && (mousePos.y < 250)) { | ||
+ | imageObj.src = 'img/team.png'; | ||
+ | imageObj2.src = 'img/parts.png'; | ||
+ | imageObj3.src = 'img/sponsorsOn.png'; | ||
+ | imageObj4.src = 'img/Project.png'; | ||
+ | } | ||
+ | else if ((mousePos.x >= 250) && (mousePos.y >= 250)) { | ||
+ | imageObj.src = 'img/team.png'; | ||
+ | imageObj2.src = 'img/parts.png'; | ||
+ | imageObj3.src = 'img/sponsors.png'; | ||
+ | imageObj4.src = 'img/ProjectOn.png'; | ||
+ | } | ||
+ | else { | ||
+ | ctx.beginPath(); | ||
+ | ctx.strokeStyle="#CFCFCF"; | ||
+ | ctx.arc(250,250,200,0,2*Math.PI,false); | ||
+ | ctx.stroke(); | ||
+ | ctx.closePath(); | ||
+ | ctx.fillStyle="#CFCFCF"; | ||
+ | ctx.fill(); | ||
+ | } | ||
+ | } | ||
+ | ); | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 02:40, 17 April 2014
Get in touch!
Visit Our Twitter Page!