Template:Code
From 2013.igem.org
(Difference between revisions)
Hristianita (Talk | contribs) |
|||
(215 intermediate revisions not shown) | |||
Line 3: | Line 3: | ||
<head> | <head> | ||
<style> | <style> | ||
- | . | + | |
- | + | #contentSub, #search-controls, .firstHeading, #footer-box, #catlinks, #p-logo { | |
- | + | display:none;} | |
+ | #top-section { | ||
+ | border: none; | ||
+ | height: 0px;} | ||
+ | #content { | ||
+ | border: none;} | ||
+ | |||
+ | body { | ||
+ | background: #04182c; | ||
+ | font-family: Arial, Times, serif; | ||
+ | font-size: 12pt; | ||
+ | } | ||
+ | |||
+ | .main_frame { | ||
+ | margin-left: 30px; | ||
+ | margin-right: 30px; | ||
} | } | ||
- | + | a { | |
- | + | color: #2b6196; | |
- | + | } | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | } | + | |
- | + | a:visited { | |
- | + | color: #428c36; | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
- | + | .heading { | |
- | + | font-family: Perpetua, serif; | |
+ | font-size: 150%; | ||
+ | } | ||
+ | |||
+ | .menu { | ||
+ | background-color: #fff; | ||
+ | margin-bottom: 10px; | ||
+ | font-weight: bold; | ||
+ | font-family: Perpetua, serif; | ||
+ | } | ||
+ | |||
+ | .menu a:visited { | ||
+ | color: #2b6196; | ||
} | } | ||
table tr td { | table tr td { | ||
vertical-align: text-top; | vertical-align: text-top; | ||
+ | color: #001f3d; | ||
} | } | ||
- | . | + | .footer { |
- | + | font-size: 11pt; | |
- | + | color: #2b6196; | |
+ | line-height: 100%; | ||
+ | margin-bottom: 10px; | ||
} | } | ||
- | + | #content { | |
+ | color: #001f3d; | ||
+ | } | ||
+ | |||
+ | #side_menu { | ||
float: left; | float: left; | ||
- | + | width:220px; | |
- | + | font-family: Perpetua, serif; | |
- | + | margin-right: 50px; | |
+ | } | ||
+ | |||
+ | #side_menu a, #side_menu a:visited{ | ||
+ | color: #428c36 | ||
+ | } | ||
+ | #side_menu ul { | ||
+ | list-style: disc; | ||
+ | margin-left: 0px; | ||
} | } | ||
- | + | #side_menu ul li{ | |
- | + | ||
- | + | ||
margin-right: 10px; | margin-right: 10px; | ||
- | + | font-size: 13.5pt; | |
font-weight: bold; | font-weight: bold; | ||
display: block; | display: block; | ||
+ | background-color: #acd8a6; | ||
+ | padding: 5px; | ||
+ | margin-bottom: 5px; | ||
} | } | ||
+ | |||
+ | ul { | ||
+ | line-height: 110%; | ||
+ | } | ||
ul.side_submenu { | ul.side_submenu { | ||
display: none; | display: none; | ||
left: -20px; | left: -20px; | ||
- | + | ||
} | } | ||
Line 70: | Line 105: | ||
} | } | ||
- | li. | + | li.side_menu_items { |
margin-left: 5px; | margin-left: 5px; | ||
color: #fff; | color: #fff; | ||
Line 84: | Line 119: | ||
</style> | </style> | ||
+ | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | ||
+ | |||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(function() { | $(function() { | ||
var menu = document.getElementById("side_menu_items"); | var menu = document.getElementById("side_menu_items"); | ||
+ | if (menu==null) return; | ||
var menu_items = menu.childNodes; | var menu_items = menu.childNodes; | ||
for (var i=0; i< menu_items.length; i++) { | for (var i=0; i< menu_items.length; i++) { | ||
if (menu_items[i].tagName == "LI") { | if (menu_items[i].tagName == "LI") { | ||
- | + | var children = menu_items[i].childNodes; | |
- | var | + | for (var j=0; j< children.length; j++) { |
+ | if (children[j].tagName == "A") { | ||
+ | children[j].onmouseover = (function() { | ||
+ | var children1 = children; | ||
return function() { | return function() { | ||
- | + | for (var j=0; j< children1.length; j++) { | |
- | + | if (children1[j].tagName == "UL") { | |
- | + | children1[j].style.display="block"; | |
- | + | } | |
- | + | } | |
- | + | } | |
- | + | ||
- | + | ||
})(); | })(); | ||
- | + | } | |
- | + | if (children[j].tagName == "UL") { | |
- | + | //var grandchildren = children[j].childNodes; | |
- | + | //for (var k=0; k < grandchildren.length; k++) { | |
- | + | // if (grandchildren[k].tagName == "LI") { | |
- | + | children[j].onmouseout = (function() { | |
- | + | var item = menu_items[i]; | |
- | + | return function() { | |
- | + | var ch = item.childNodes; | |
- | + | for (var l=0; l< ch.length; l++) { | |
+ | if (ch[l].tagName == "UL") { | ||
+ | ch[l].style.display= "none"; | ||
+ | } | ||
+ | } | ||
- | + | } | |
+ | })(); | ||
+ | children[j].onmousemove = (function() { | ||
+ | var item = menu_items[i]; | ||
+ | return function() { | ||
+ | var chi = item.childNodes; | ||
+ | for (var l=0; l< chi.length; l++){ | ||
+ | if (chi[l].tagName == "UL") { | ||
+ | chi[l].style.display="block"; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | } | ||
})(); | })(); | ||
+ | //} | ||
+ | // } | ||
+ | } | ||
+ | } | ||
} | } | ||
} | } | ||
}); | }); | ||
- | |||
- | for( var index = 0; index < links.length; index++ ) { | + | $(function() { |
- | + | var links = document.getElementsByTagName( 'a' ); | |
- | } | + | for( var index = 0; index < links.length; index++ ) { |
- | + | links[index].removeAttribute( 'title' ); | |
+ | } | ||
+ | }); | ||
+ | function getScrollTop() { | ||
+ | if (typeof window.pageYOffset !== 'undefined' ) { | ||
+ | // Most browsers | ||
+ | return window.pageYOffset; | ||
+ | } | ||
+ | |||
+ | var d = document.documentElement; | ||
+ | if (d.clientHeight) { | ||
+ | // IE in standards mode | ||
+ | return d.scrollTop; | ||
+ | } | ||
+ | |||
+ | // IE in quirks mode | ||
+ | return document.body.s; | ||
+ | } | ||
+ | |||
+ | $(function() { | ||
+ | var menu_buttons = document.getElementsByClassName("menu_button"); | ||
+ | for (var i = 0; i < menu_buttons.length; i++) { | ||
+ | var count = 0; | ||
+ | var active=1; | ||
+ | var children = menu_buttons[i].childNodes; | ||
+ | for (var j=0; j< children.length; j++) { | ||
+ | if (children[j].tagName == "A") { | ||
+ | if (window.location.href.indexOf(children[j].href,window.location.href.length - children[j].href.length) > -1) { | ||
+ | if (active==1) active = 3; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | for (var j=0; j< children.length; j++) { | ||
+ | if (children[j].tagName == "A") { | ||
+ | var grandchildren = children[j].childNodes; | ||
+ | for (var k=0; k< grandchildren.length; k++) { | ||
+ | if (grandchildren[k].tagName == "IMG") { | ||
+ | count = count + 1; | ||
+ | if (count==active) { | ||
+ | grandchildren[k].style.display = "block"; | ||
+ | } else { | ||
+ | grandchildren[k].style.display = "none"; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | menu_buttons[i].onmouseover = (function() { | ||
+ | var children = menu_buttons[i].childNodes; | ||
+ | return function() { | ||
+ | var count = 0; | ||
+ | var active = 2; | ||
+ | for (var j=0; j< children.length; j++) { | ||
+ | if (children[j].tagName == "A") { | ||
+ | var grandchildren = children[j].childNodes; | ||
+ | for (var k=0; k< grandchildren.length; k++) { | ||
+ | if (grandchildren[k].tagName == "IMG") { | ||
+ | count = count + 1; | ||
+ | if (count==active) { | ||
+ | grandchildren[k].style.display = "block"; | ||
+ | } else { | ||
+ | grandchildren[k].style.display = "none"; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | })(); | ||
+ | menu_buttons[i].onmouseout = (function() { | ||
+ | var children = menu_buttons[i].childNodes; | ||
+ | return function() { | ||
+ | var count = 0; | ||
+ | var active = 1; | ||
+ | for (var j=0; j< children.length; j++) { | ||
+ | if (children[j].tagName == "A") { | ||
+ | if (window.location.href.indexOf(children[j].href,window.location.href.length - children[j].href.length) > -1) { | ||
+ | if (active==1) active = 3; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | for (var j=0; j< children.length; j++) { | ||
+ | if (children[j].tagName == "A") { | ||
+ | var grandchildren = children[j].childNodes; | ||
+ | for (var k=0; k< grandchildren.length; k++) { | ||
+ | if (grandchildren[k].tagName == "IMG") { | ||
+ | count = count + 1; | ||
+ | if (count==active) { | ||
+ | grandchildren[k].style.display = "block"; | ||
+ | } else { | ||
+ | grandchildren[k].style.display = "none"; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | })(); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | </script> | ||
</head> | </head> | ||
</html> | </html> |
Latest revision as of 15:44, 27 September 2013