Team:Manchester
From 2013.igem.org
(Difference between revisions)
Line 37: | Line 37: | ||
Please enjoy :) . | Please enjoy :) . | ||
===================================================================--> | ===================================================================--> | ||
- | + | <!--==========================Javascript for MENU (written below)================--> | |
- | + | <script type="text/javascript"> | |
- | + | var fisheyemenu = { | |
- | + | startSize : 65, | |
- | <!--========================== | + | endSize : 90, |
- | + | imgType : ".png", | |
- | < | + | init : function () { |
- | + | var animElements = document.getElementById("fisheye_menu").getElementsByTagName("img"); | |
- | + | var titleElements = document.getElementById("fisheye_menu").getElementsByTagName("span"); | |
- | + | for(var j=0; j<titleElements.length; j++) { | |
- | + | titleElements[j].style.display = 'none'; | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
- | + | for(var i=0; i<animElements.length; i++) { | |
- | + | var y = animElements[i]; | |
- | + | y.style.width = fisheyemenu.startSize+'px'; | |
- | + | y.style.height = fisheyemenu.startSize+'px'; | |
+ | fisheyemenu.imgSmall(y); | ||
+ | animElements[i].onmouseover = changeSize; | ||
+ | animElements[i].onmouseout = restoreSize; | ||
} | } | ||
- | + | function changeSize() { | |
- | + | fisheyemenu.imgLarge(this); | |
- | + | var x = this.parentNode.getElementsByTagName("span"); | |
- | + | x[0].style.display = 'block'; | |
- | + | if (!this.currentWidth) this.currentWidth = fisheyemenu.startSize; | |
- | + | fisheyemenu.resizeAnimation(this,this.currentWidth,fisheyemenu.endSize,15,10,0.333); | |
- | + | ||
- | + | ||
} | } | ||
- | + | function restoreSize() { | |
- | + | var x = this.parentNode.getElementsByTagName("span"); | |
- | + | x[0].style.display = 'none'; | |
- | + | if (!this.currentWidth) return; | |
- | + | fisheyemenu.resizeAnimation(this,this.currentWidth,fisheyemenu.startSize,15,10,0.5); | |
- | + | fisheyemenu.imgSmall(this); | |
- | + | ||
} | } | ||
- | + | }, | |
- | + | resizeAnimation : function (elem,startWidth,endWidth,steps,intervals,powr) { | |
- | . | + | if (elem.widthChangeMemInt) window.clearInterval(elem.widthChangeMemInt); |
- | + | var actStep = 0; | |
- | + | elem.widthChangeMemInt = window.setInterval( | |
- | + | function() { | |
- | + | elem.currentWidth = fisheyemenu.easeInOut(startWidth,endWidth,steps,actStep,powr); | |
+ | elem.style.width = elem.currentWidth+"px"; | ||
+ | elem.style.height = elem.currentWidth+"px"; | ||
+ | actStep++; | ||
+ | if (actStep > steps) window.clearInterval(elem.widthChangeMemInt); | ||
} | } | ||
- | . | + | ,intervals) |
- | + | }, | |
+ | easeInOut : function (minValue,maxValue,totalSteps,actualStep,powr) { | ||
+ | //Generic Animation Step Value Generator By www.hesido.com | ||
+ | var delta = maxValue - minValue; | ||
+ | var stepp = minValue+(Math.pow(((1 / totalSteps)*actualStep),powr)*delta); | ||
+ | return Math.ceil(stepp) | ||
+ | }, | ||
+ | imgSmall : function (obj) { | ||
+ | imgSrc = obj.getAttribute("src"); | ||
+ | var typePos = imgSrc.indexOf(fisheyemenu.imgType, 0); | ||
+ | var imgName = imgSrc.substr(0, typePos); | ||
+ | obj.setAttribute("src", imgName+"_small"+fisheyemenu.imgType); | ||
+ | }, | ||
+ | imgLarge : function (obj) { | ||
+ | imgSrc = obj.getAttribute("src"); | ||
+ | var typePos = imgSrc.indexOf("_small", 0); | ||
+ | var imgName = imgSrc.substr(0, typePos); | ||
+ | obj.setAttribute("src", imgName+fisheyemenu.imgType); | ||
} | } | ||
- | |||
- | |||
- | |||
} | } | ||
- | . | + | // Add event with wide browser support |
- | + | if ( typeof window.addEventListener != "undefined" ) | |
- | + | window.addEventListener( "load", fisheyemenu.init, false ); | |
- | + | else if ( typeof window.attachEvent != "undefined" ) | |
- | + | window.attachEvent( "onload", fisheyemenu.init ); | |
- | + | else { | |
- | + | if ( window.onload != null ) { | |
- | + | var oldOnload = window.onload; | |
- | + | window.onload = function ( e ) { | |
- | + | oldOnload( e ); | |
- | + | fisheyemenu.init(); | |
- | + | }; | |
- | . | + | } |
- | + | else | |
- | + | window.onload = fisheyemenu.init; | |
- | . | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
+ | </script> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
+ | <body style="overflow-y:scroll;" > | ||
- | + | <!--==========================TOP MENU================--> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | <div class="container" style=" background: #147025; margin-top:-1240px;"> | |
- | + | <div align=left style="margin-top:0px; margin-left:0px;"> | |
- | + | <img src="https://static.igem.org/mediawiki/2012/5/5d/Toronto_green.jpg" alt="Background" width="965" height="130"/> | |
- | + | </div> | |
- | + | ||
- | background: # | + | <div style="margin-top:-125px"> |
- | + | <ul id="fisheye_menu"> | |
- | + | <li> <font color=#147025> </font> </li> | |
- | + | <li><a href="https://2012.igem.org/Team:Toronto" class="fisheye"><img src="http://igemtoronto.files.wordpress.com/2012/07/toronto_home.png" alt="" /><span> <font size=3><b>Home </span></a> </li> | |
- | margin | + | <li><a href="https://2012.igem.org/Team:Toronto/Contact" class="fisheye"><img src="http://igemtoronto.files.wordpress.com/2012/07/toronto_email.png" alt="" /><span>Contact</span></a></li> |
- | + | <li><a href="https://2012.igem.org/Team:Toronto/Team" class="fisheye"><img src="http://igemtoronto.files.wordpress.com/2012/07/toronto_teamicon.png" alt="" /><span>Team</span></a></li> | |
- | + | <li><a href="https://2012.igem.org/Team:Toronto/Project" class="fisheye"><img src="http://igemtoronto.files.wordpress.com/2012/07/toronto_projecticon.png" alt="" /><span>Project</span></a> </li> | |
- | + | <li><a href="https://2012.igem.org/Team:Toronto/Notebook" class="fisheye"><img src="http://igemtoronto.files.wordpress.com/2012/07/toronto_notebook.png" alt="" /><span>Notebook</span></a></li> | |
- | + | <li><a href="https://2012.igem.org/Team:Toronto/Attributions" class="fisheye"><img src="http://igemtoronto.files.wordpress.com/2012/07/toronto_history.png" alt="" /><span>Attributions </span></a></li> | |
- | + | <li><a href="https://2012.igem.org/Team:Toronto/HumanPractice" class="fisheye"><img src="http://igemtoronto.files.wordpress.com/2012/07/toronto_outreach.png" alt="" /><span>Human Practice (Safety & Outreach)</span></a></li> | |
- | + | <li><a href="https://2012.igem.org/Main_Page" class="fisheye"><img src="http://igemtoronto.files.wordpress.com/2012/07/toronto_igemlogo.png" alt="" /><span>iGEM 2012 Home</span></a></li> | |
- | + | </ul> </font></b> </div> | |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | - | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | . | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | margin- | + | |
- | + | ||
- | + | ||
- | # | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | . | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | . | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | . | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | . | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | li | + | |
- | + | ||
- | + | ||
- | </ | + |
Revision as of 18:27, 17 June 2013