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. |
- | + | $( ".annotation" ).each(function(elem) { | |
- | + | var thise = $(this); | |
- | + | var e = thise.attr('ref'); | |
- | + | var reff = $('#' + e); | |
- | + | if (reff) { | |
- | + | 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' | |
- | + | }); | |
- | + | } | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
}); | }); | ||
Line 40: | Line 36: | ||
} | } | ||
- | + | 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