Team:Waterloo/Gallery
From 2014.igem.org
(Difference between revisions)
Line 9: | Line 9: | ||
</style> | </style> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
<div id="gallery"> | <div id="gallery"> | ||
Line 55: | Line 40: | ||
- | <script type="text/javascript"> | + | <script type ="text/javascript"> |
- | $( "#gallery" ).jGallery( { | + | //Align headings |
+ | function alignHeadings(){ | ||
+ | var remainingWidth = $("div#topbar").width(); | ||
+ | var allheadings = $("ul#headings >li"); | ||
+ | allheadings.css("display", "block"); | ||
+ | $("ul#shortheadings >li").css("display", "none"); | ||
+ | allheadings.width(remainingWidth / (allheadings.length + 0.5)) | ||
+ | .css({"text-align":"center","line-height":"150%"}); | ||
+ | } | ||
+ | |||
+ | (function(){ | ||
+ | $("#gallery").jGallery({ | ||
"transition":"moveToRight_moveFromLeft", | "transition":"moveToRight_moveFromLeft", | ||
"transitionBackward":"moveToLeft_moveFromRight", | "transitionBackward":"moveToLeft_moveFromRight", | ||
Line 66: | Line 62: | ||
"textColor":"#fff", | "textColor":"#fff", | ||
"mode":"standard" | "mode":"standard" | ||
- | } ); | + | }))(); |
- | + | ||
- | $( | + | $(document).ready(alignHeadings); |
- | + | $(window).resize(alignHeadings); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
</script> | </script> | ||
Revision as of 07:36, 17 October 2014