Template:Team:Hannover/main.tmpl

From 2014.igem.org

(Difference between revisions)
 
(24 intermediate revisions not shown)
Line 1: Line 1:
<html>
<html>
 +
<head>
 +
<script src="/Team:Hannover/jquery-1.11.0.min?action=raw&amp;type=text/javascript" type="text/javascript"></script>
 +
<script src="/Team:Hannover/lightbox.min?action=raw&amp;type=text/javascript" type="text/javascript"></script>
 +
</head>
<body>
<body>
-
 
+
<div id="banner">
-
<map name="igem_hannover_2014_menu" id="igem_hannover_2014_menu">
+
<a style="display:block; height:100%">
-
<area shape="rect" coords="76,28,184,60" href="https://2014.igem.org/Team:Hannover" onMouseover="menu_onMouseOver('HOME');" onMouseout="menu_onMouseOut();" alt="Wiki Home Page - iGem Team Hannover 2014" title="Wiki Home Page - iGem Team Hannover 2014" />
+
<a href="https://2014.igem.org/Team:Hannover"></a>
-
<area shape="rect" coords="195,19,343,50" href="https://2014.igem.org/Team:Hannover/Project" onMouseover="menu_onMouseOver('PROJECT');" onMouseout="menu_onMouseOut();" alt="Project - iGem Team Hannover 2014" title="Project - iGem Team Hannover 2014" />
+
</div>
-
<area shape="rect" coords="357,22,626,57" href="https://2014.igem.org/Team:Hannover/Safety" onMouseover="menu_onMouseOver('HUMAN-PRACTICE');" onMouseout="menu_onMouseOut();" alt="Human Practice - iGem Team Hannover 2014" title="Human Practice - iGem Team Hannover 2014" />
+
-
<area shape="poly" coords="644,18,645,19,750,25,748,57,641,51" href="https://2014.igem.org/Team:Hannover/Team" onMouseover="menu_onMouseOver('TEAM');" onMouseout="menu_onMouseOut();" alt="iGem Team Hannover 2014" title="iGem Team Hannover 2014" />
+
-
<area shape="poly" coords="20,4,21,5,2,31,2,38,38,52,60,38,61,24,28,0" href="https://2014.igem.org/Main_Page" alt="iGem 2014 - Main Page" title="iGem 2014 - Main Page" />
+
-
</map>
+
-
<style>
+
-
#preload-01 { background: url(https://static.igem.org/mediawiki/2014/c/ce/Hannover_20140831_MENU-HOME.png
+
-
) no-repeat -9999px -9999px; }
+
-
#preload-02 { background: url(https://static.igem.org/mediawiki/2014/2/25/Hannover_20140831_MENU-TEAM.png
+
-
) no-repeat -9999px -9999px; }
+
-
#preload-03 { background: url(https://static.igem.org/mediawiki/2014/b/b0/Hannover_20140831_MENU-PROJECT.png
+
-
) no-repeat -9999px -9999px; }
+
-
#preload-04 { background: url(https://static.igem.org/mediawiki/2014/d/dc/Hannover_20140831_MENU-HUMAN-PRACTICE.png) no-repeat -9999px -9999px; }
+
-
#menu_image {
+
-
    display: block;
+
-
    margin-left: auto;
+
-
    margin-right: auto;
+
-
}
+
-
</style>
+
-
<div id='#preload-01' ></div><div id='#preload-02' ></div><div id='#preload-03' ></div><div id='#preload-04' ></div>
+
<script type='text/javascript'>
<script type='text/javascript'>
-
 
+
function annotate_all() {
-
var menu_currentPage = 'ANY';
+
// Move all annotations to the height of the referred element.
-
 
+
$( ".annotation" ).each(function(elem) {
-
var pageMap = {
+
  var thise = $(this);
-
     'HOME' : 'https://static.igem.org/mediawiki/2014/c/ce/Hannover_20140831_MENU-HOME.png',
+
  var e = thise.attr('ref');
-
     'TEAM' : 'https://static.igem.org/mediawiki/2014/2/25/Hannover_20140831_MENU-TEAM.png',
+
  var reff = $('#' + e);
-
    'PROJECT' : 'https://static.igem.org/mediawiki/2014/b/b0/Hannover_20140831_MENU-PROJECT.png',
+
  if (reff) {
-
    'HUMAN-PRACTICE' : 'https://static.igem.org/mediawiki/2014/d/dc/Hannover_20140831_MENU-HUMAN-PRACTICE.png'
+
     var apos = thise.offset();
 +
    var rpos = reff.offset();
 +
    var opos = thise.position();
 +
    opos.top = opos.top - apos.top + rpos.top - 10;
 +
     thise.css({
 +
      'vi' : 'absolute' ,  
 +
      'top' : opos.top,
 +
      'left' : opos.left,
 +
      'visibility' : 'visible'
 +
    });
 +
  }
 +
});
}
}
-
function menu_beginsWithLower(needle, haystack){
 
-
    var h = haystack.toLowerCase();
 
-
    var n = needle.toLowerCase();
 
-
    return (h.substr(0, n.length) == n);
 
-
}
 
-
function menu_init() {
+
function preload(arrayOfImages) {
-
      var loc = document.location.href;
+
    $(arrayOfImages).each(function(){
-
      if (menu_beginsWithLower('https://2014.igem.org/Team:Hannover', loc)) {
+
        (new Image()).src = this;
-
            menu_currentPage= 'HOME';
+
    });
-
      } else if (menu_beginsWithLower('https://2014.igem.org/Team:Hannover/Project', loc)) {
+
-
            menu_currentPage= 'PROJECT';
+
-
      } else if (menu_beginsWithLower('https://2014.igem.org/Team:Hannover/Safety', loc)) {
+
-
            menu_currentPage= 'HUMAN-PRACTICE';
+
-
      } else if (menu_beginsWithLower('https://2014.igem.org/Team:Hannover/Team', loc)) {
+
-
            menu_currentPage= 'TEAM';
+
-
      }  
+
-
      var menu_image_src = pageMap[currentPage];
+
-
      $('#menu_image').attr('src', menu_image_src);
+
}
}
-
function menu_onMouseOut() {
+
function preload_menu() {
-
      var menu_image_src = pageMap[currentPage];
+
  // Preload images..
-
      $('#menu_image').attr('src', menu_image_src);
+
  preload([
 +
    'https://static.igem.org/mediawiki/2014/8/88/Hannover_20140901_MENU-HUMAN-PRACTICE.gif',
 +
    'https://static.igem.org/mediawiki/2014/3/3d/Hannover_20140901_MENU-TEAM.gif',
 +
    'https://static.igem.org/mediawiki/2014/7/7d/Hannover_20140901_MENU-PROJECT.gif',
 +
    'https://static.igem.org/mediawiki/2014/c/cd/Hannover_20140901_MENU-HOME.gif'
 +
  ]);
}
}
-
function menu_onMouseOver(menu_item) {
+
$( document ).ready( annotate_all );
-
      var menu_image_src = pageMap[menu_item];
+
$( window ).resize( annotate_all );
-
      $('#menu_image').attr('src', menu_image_src);
+
$( document ).ready( preload_menu );
-
}
+
-
 
+
-
$( document ).ready( menu_init() );
+
</script>
</script>
-
 
-
<div id="banner"><a style="display:block; height:100%">
 
-
              <a href="https://2014.igem.org/Team:Hannover"></a>
 
-
      </div>
 
-
 
-
<div id="main_menue">
 
-
<div id="main_box">
 
-
 
-
<img id='menu_image' src="https://static.igem.org/mediawiki/2014/0/04/Hannover_20140831_MENU-ANY.png" width="756" height="64" border="0" alt="" title="" usemap="#igem_hannover_2014_menu" />
 
-
 
-
<!-- ALTE NAVIGATION, ANDI
 
-
              <div id="banner"><a style="display:block; height:100%">
 
-
              <a href="https://2014.igem.org/Team:Hannover"></a>
 
-
      </div>
 
-
 
-
<div id="main_menue">
 
-
<ul id="nav">
 
-
              <li><div class="main_menueButtonActual">
 
-
              <a href="https://2014.igem.org/Main_Page"style="color:#000000">
 
-
        <img src="https://static.igem.org/mediawiki/2014/6/6b/Hannover_20140817_Button_igem.png"
 
-
              margin:0 10px 0 10px;  height="30px"; width="auto"></a></div>
 
-
      </li>
 
-
 
-
              <li><div class="ul#nav"><a href="https://2014.igem.org/Team:Hannover"style="color:#000000">
 
-
        <p class="text_button"><font color="1B2E45">Home</font></p></a>
 
-
              </div></li>
 
-
 
-
              <li><div class="ul#nav">
 
-
              <a href="https://2014.igem.org/Team:Hannover/Project"style="color:#000000">
 
-
        <p class="text_button"><font color="1B2E45">Project</font></p></a>
 
-
              </div>
 
-
 
-
                  <ul><div class="ul#nav">
 
-
                      <a href="https://2014.igem.org/Team:Hannover/Results"style="color:#000000">
 
-
                <p class="text_button"><font color="#f58800">Results</font></p></a>
 
-
                      </div>
 
-
                  <li><div class="ul#nav">
 
-
                      <a href="https://2014.igem.org/Team:Hannover/Parts"style="color:#000000">
 
-
                <p class="text_button"><font color="#f58800">Parts</font></p></a>
 
-
                      </div></li>
 
-
                  <li><div class="ul#nav">
 
-
                      <a href="https://2014.igem.org/Team:Hannover/Modeling"style="color:#000000">
 
-
                <p class="text_button"><font color="#f58800">Modeling</font></p></a>
 
-
                      </div></li>
 
-
                  <li><div class="ul#nav">
 
-
                      <a href="https://2014.igem.org/Team:Hannover/Notebook"style="color:#000000">
 
-
                <p class="text_button"><font color="#f58800">Notebook</font></p></a>
 
-
                      </div></li>
 
-
                  </ul>
 
-
                  </li>
 
-
 
-
              <li><div class="ul#nav">
 
-
              <a href="https://2014.igem.org/Team:Hannover/Safety"style="color:#000000">
 
-
        <p class="text_button"><font color="1B2E45">Human Practice</font></p></a>
 
-
              </div></li>
 
-
 
-
              <li><div class="ul#nav">
 
-
              <a href="https://2014.igem.org/Team:Hannover/Team"style="color:#000000">
 
-
        <p class="text_button"><font color="1B2E45">Team & Support</font></p></a>
 
-
              </div></li>
 
-
             
 
-
              </ul>
 
-
 
-
-->
 
-
</div>
 
-
</div>
 
</body>
</body>
</html>
</html>

Latest revision as of 13:49, 1 October 2014