|
|
Line 205: |
Line 205: |
| } | | } |
| | | |
- | canvas.addEventListener('mousemove', function(evt){
| + | |
- | var mousePos = getMousePos(canvas, evt);
| + | |
- | if ((mousePos.x < 250) && (mousePos.y < 250)) {
| + | |
- | imageObj.src = 'https://static.igem.org/mediawiki/2014hs/4/42/TeamOn.png';
| + | |
- | imageObj2.src = 'https://static.igem.org/mediawiki/2014hs/7/79/Parts.png';
| + | |
- | imageObj3.src = 'https://static.igem.org/mediawiki/2014hs/1/16/Sponsors.png';
| + | |
- | imageObj4.src = 'https://static.igem.org/mediawiki/2014hs/9/92/Project.png';
| + | |
- | }
| + | |
- | else if ((mousePos.x < 250) && (mousePos.y >= 250)) {
| + | |
- | imageObj.src = 'https://static.igem.org/mediawiki/2014hs/3/32/Team.png';
| + | |
- | imageObj2.src = 'https://static.igem.org/mediawiki/2014hs/4/4e/PartsOn.png';
| + | |
- | imageObj3.src = 'https://static.igem.org/mediawiki/2014hs/1/16/Sponsors.png';
| + | |
- | imageObj4.src = 'https://static.igem.org/mediawiki/2014hs/9/92/Project.png';
| + | |
- | }
| + | |
- | else if ((mousePos.x >= 250) && (mousePos.y < 250)) {
| + | |
- | imageObj.src = 'https://static.igem.org/mediawiki/2014hs/3/32/Team.png';
| + | |
- | imageObj2.src = 'https://static.igem.org/mediawiki/2014hs/7/79/Parts.png';
| + | |
- | imageObj3.src = 'https://static.igem.org/mediawiki/2014hs/2/20/SponsorsOn.png';
| + | |
- | imageObj4.src = 'https://static.igem.org/mediawiki/2014hs/9/92/Project.png';
| + | |
- | }
| + | |
- | else if ((mousePos.x >= 250) && (mousePos.y >= 250)) {
| + | |
- | imageObj.src = 'https://static.igem.org/mediawiki/2014hs/3/32/Team.png';
| + | |
- | imageObj2.src = 'https://static.igem.org/mediawiki/2014hs/7/79/Parts.png';
| + | |
- | imageObj3.src = 'https://static.igem.org/mediawiki/2014hs/1/16/Sponsors.png';
| + | |
- | imageObj4.src = 'https://static.igem.org/mediawiki/2014hs/4/4b/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> |