Template:Team:Hannover/new main.tmpl
From 2014.igem.org
(Difference between revisions)
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 | |
- | + | }); | |
- | + | } | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
}); | }); | ||
Line 40: | Line 35: | ||
} | } | ||
+ | function onready() { | ||
+ | annotate_all(); | ||
// Preload images.. | // Preload images.. | ||
preload([ | preload([ | ||
Line 48: | Line 45: | ||
'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' | ||
]); | ]); | ||
+ | } | ||
+ | |||
+ | $( document ).ready( onready ); | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 16:31, 11 September 2014