Template:Team:Hannover/new main.tmpl

From 2014.igem.org

(Difference between revisions)
 
(One intermediate revision not shown)
Line 9: Line 9:
function annotate_all() {
function annotate_all() {
-
$( ".annotation" ).each(function(elem) {
+
// Move all annotations to the height of the referred element.
-
  var e = $(this).attr('ref');
+
$( ".annotation" ).each(function(elem) {
-
  var thise = $(this);
+
  var thise = $(this);
-
  var apos = $(this).offset();
+
  var e = thise.attr('ref');
-
  var reff = $('#' + e);
+
  var reff = $('#' + e);
-
  var rpos = reff.offset();
+
  if (reff) {
-
  var opos = thise.position();
+
    var apos = thise.offset();  
-
  opos.top = opos.top - apos.top + rpos.top;
+
    var rpos = reff.offset();
-
 
+
    var opos = thise.position();
-
  thise.css({
+
    opos.top = opos.top - apos.top + rpos.top - 10;
-
    'position' : 'absolute' ,  
+
    thise.css({
-
    'top' : opos.top,
+
      'vi' : 'absolute' ,  
-
    'left' : opos.left
+
      'top' : opos.top,
-
  });
+
      'left' : opos.left,
-
   console.log(opos.top);
+
      'visibility' : 'visible'
-
  console.log(rpos.top);
+
    });
-
 
+
   }
-
  console.log(opos.top);
+
-
  thise.position(opos);
+
-
  var opos2 = thise.position();
+
-
  console.log(opos2);
+
});
});
Line 40: Line 36:
}
}
-
// Preload images..
+
function preload_menu() {
-
preload([
+
    preload([
     'https://static.igem.org/mediawiki/2014/4/4a/20140909_MENU-NEW-HOME.gif',
     'https://static.igem.org/mediawiki/2014/4/4a/20140909_MENU-NEW-HOME.gif',
     'https://static.igem.org/mediawiki/2014/7/7f/20140909_MENU-NEW-PROJECT.gif',
     'https://static.igem.org/mediawiki/2014/7/7f/20140909_MENU-NEW-PROJECT.gif',
Line 47: Line 43:
     'https://static.igem.org/mediawiki/2014/1/15/20140909_MENU-NEW-HUMAN-PRACTICE.gif',
     'https://static.igem.org/mediawiki/2014/1/15/20140909_MENU-NEW-HUMAN-PRACTICE.gif',
     'https://static.igem.org/mediawiki/2014/0/06/20140909_MENU-NEW-TEAM.gif'
     'https://static.igem.org/mediawiki/2014/0/06/20140909_MENU-NEW-TEAM.gif'
-
]);
+
    ]);
 +
}
 +
 
 +
function onready() {
 +
    annotate_all();
 +
    preload_menu();
 +
}
 +
 
 +
$( document ).ready( onready );
</script>
</script>
</body>
</body>
</html>
</html>

Latest revision as of 16:35, 11 September 2014