Team:Heidelberg/Templates/StartPage
From 2013.igem.org
(Difference between revisions)
m |
|||
Line 70: | Line 70: | ||
var beta = Math.atan(a / b * Math.tan(t)); | var beta = Math.atan(a / b * Math.tan(t)); | ||
var angle = Math.PI * 0.5 - beta; | var angle = Math.PI * 0.5 - beta; | ||
- | return angle; | + | var y = b * Math.sin(t); |
+ | return Array(angle,y); | ||
} | } | ||
function rotateMenu(id, angle) | function rotateMenu(id, angle) | ||
{ | { | ||
var root = document.getElementById(id); | var root = document.getElementById(id); | ||
- | root.style = "transform:rotate(" + angle + "rad)"; | + | root.style = "transform:rotate(" + angle + "rad);position:relative;top:" + (angle[1] - 20) + "px;"; |
var children = root.children; | var children = root.children; | ||
for (var i = 0; i < children.length; ++i) { | for (var i = 0; i < children.length; ++i) { | ||
if (children[i].nodeName == "UL") { | if (children[i].nodeName == "UL") { | ||
- | children[i].style = "transform:rotate(" + (angle * -1) + "rad)"; | + | children[i].style = "transform:rotate(" + (angle[0] * -1) + "rad)"; |
} | } | ||
} | } |
Revision as of 14:18, 21 August 2013