Template:Team:Edinburgh/Code
From 2013.igem.org
(Difference between revisions)
Hristianita (Talk | contribs) |
Hristianita (Talk | contribs) (Undo revision 247437 by Hristianita (talk)) |
||
Line 127: | Line 127: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
+ | $(function() { | ||
+ | |||
+ | $(".selflink").parentsUntil($("#side_menu"), "li").children("ul").css("display","block"); | ||
+ | |||
+ | }); | ||
+ | |||
+ | $(function() { | ||
+ | var links = document.getElementsByTagName( 'a' ); | ||
+ | for( var index = 0; index < links.length; index++ ) { | ||
+ | links[index].removeAttribute( 'title' ); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | $(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> | ||
+ | |||
+ | <script type="text/javascript"> | ||
//Javascript name: My Date Time Picker | //Javascript name: My Date Time Picker | ||
Line 180: | Line 278: | ||
calhtml = "<form name='Calendar'>"; | calhtml = "<form name='Calendar'>"; | ||
- | vCalHeader="<table border= | + | vCalHeader="<table border=1 cellpadding=1 cellspacing=1 align=\"center\" valign=\"top\">\n"; |
//Month Selector | //Month Selector | ||
vCalHeader+="<tr>\n<td colspan='7'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'>\n"; | vCalHeader+="<tr>\n<td colspan='7'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'>\n"; | ||
Line 324: | Line 422: | ||
return (this.GetMonthName(false)+DateSeparator+pDate+DateSeparator+this.Year); | return (this.GetMonthName(false)+DateSeparator+pDate+DateSeparator+this.Year); | ||
} | } | ||
- | Calendar.prototype.FormatDate=FormatDate; | + | Calendar.prototype.FormatDate=FormatDate; |
$(function() { | $(function() { |
Revision as of 09:53, 29 September 2013