Template:Team:Waterloo/JS/baseWiki
From 2014.igem.org
(Difference between revisions)
(21 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
+ | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | ||
<script> | <script> | ||
Line 5: | Line 6: | ||
function alignHeadings(){ | function alignHeadings(){ | ||
var remainingWidth = $("div#topbar").width(); | var remainingWidth = $("div#topbar").width(); | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
var allheadings = $("ul#headings >li"); | var allheadings = $("ul#headings >li"); | ||
allheadings.css("display", "block"); | allheadings.css("display", "block"); | ||
Line 16: | Line 11: | ||
allheadings.width(remainingWidth / (allheadings.length + 0.5)) | allheadings.width(remainingWidth / (allheadings.length + 0.5)) | ||
.css({"text-align":"center","line-height":"150%"}); | .css({"text-align":"center","line-height":"150%"}); | ||
- | |||
- | |||
- | |||
} | } | ||
Line 36: | Line 28: | ||
} | } | ||
} | } | ||
+ | |||
+ | function onHover(id, image){ | ||
+ | $("#"+id).attr('src', image); | ||
+ | } | ||
+ | |||
+ | function offHover(id, image){ | ||
+ | $("#"+id).attr('src', image); | ||
+ | } | ||
+ | |||
+ | /*$('ul.tabs').each(function(){ | ||
+ | var $active, $content, $links = $(this).find('a'); | ||
+ | |||
+ | $active = $($links.filter('[href="'+location.hash+'"]')[0] || $links[0]); | ||
+ | $active.addClass('selected'); | ||
+ | |||
+ | $content = $($active[0].hash); | ||
+ | |||
+ | $links.not($active).each(function () { | ||
+ | $(this.hash).hide(); | ||
+ | }); | ||
+ | |||
+ | $(this).on('click', 'a', function(e){ | ||
+ | |||
+ | $active.removeClass('selected'); | ||
+ | $content.hide(); | ||
+ | |||
+ | $active = $(this); | ||
+ | $content = $(this.hash); | ||
+ | |||
+ | $active.addClass('selected'); | ||
+ | $content.show(); | ||
+ | |||
+ | e.preventDefault(); | ||
+ | }); | ||
+ | });*/ | ||
</script> | </script> | ||
</html> | </html> |
Latest revision as of 05:06, 16 October 2014