Team:Wageningen UR/templates/footer
From 2014.igem.org
(Difference between revisions)
Line 14: | Line 14: | ||
<div id="footer"> | <div id="footer"> | ||
- | <p>iGEM Wageningen UR 2014. Follow us on <a href=" | + | <p>iGEM Wageningen UR 2014. Follow us on <a href="https://twitter.com/igemwageningen">Twitter</a> and <a href="https://www.facebook.com/iGEMWageningen">Facebook</a>! |
<br /> | <br /> | ||
- | For more information about iGEM, check out their <a href="https://igem.org">website</a> and <a href=" | + | For more information about iGEM, check out their <a href="https://igem.org">website</a> and <a href="https://twitter.com/igem">Twitter</a>!</p> |
</div> | </div> | ||
+ | <script> | ||
+ | $(document).ready(function(){ | ||
+ | /** | ||
+ | * This part handles the highlighting functionality. | ||
+ | * We use the scroll functionality again, some array creation and | ||
+ | * manipulation, class adding and class removing, and conditional testing | ||
+ | */ | ||
+ | var aChildren = $("sidenav li").children(); // find the a children of the list items | ||
+ | var aArray = []; // create the empty aArray | ||
+ | for (var i=0; i < aChildren.length; i++) { | ||
+ | var aChild = aChildren[i]; | ||
+ | var ahref = $(aChild).attr('href'); | ||
+ | aArray.push(ahref); | ||
+ | } // this for loop fills the aArray with attribute href values | ||
+ | |||
+ | $(window).scroll(function(){ | ||
+ | var windowPos = $(window).scrollTop(); // get the offset of the window from the top of page | ||
+ | var windowHeight = $(window).height(); // get the height of the window | ||
+ | var docHeight = $(document).height(); | ||
+ | |||
+ | for (var i=0; i < aArray.length; i++) { | ||
+ | var theID = aArray[i]; | ||
+ | var divPos = $(theID).offset().top; // get the offset of the div from the top of page | ||
+ | var divHeight = $(theID).height(); // get the height of the div in question | ||
+ | if (windowPos >= divPos && windowPos < (divPos + divHeight)) { | ||
+ | $("a[href='" + theID + "']").addClass("sidenav-active"); | ||
+ | } else { | ||
+ | $("a[href='" + theID + "']").removeClass("sidenav-active"); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(windowPos + windowHeight == docHeight) { | ||
+ | if (!$("sidenav li:last-child a").hasClass("sidenav-active")) { | ||
+ | var sidenavActiveCurrent = $(".sidenav-active").attr("href"); | ||
+ | $("a[href='" + sidenavActiveCurrent + "']").removeClass("sidenav-active"); | ||
+ | $("sidenav li:last-child a").addClass("sidenav-active"); | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
+ | |||
+ | <script> | ||
+ | $(document).ready(function() { | ||
+ | $.timeliner({ | ||
+ | startOpen:['#02w1EX', '#02w2EX'] <!--Initial opened journal--> | ||
+ | }); | ||
+ | $.timeliner({ | ||
+ | timelineContainer: '#timelineContainer_2' | ||
+ | }); | ||
+ | // Colorbox Modal | ||
+ | $(".CBmodal").colorbox({inline:true, initialWidth:100, maxWidth:682, initialHeight:100, transition:"elastic",speed:750}); | ||
+ | }); | ||
+ | </script> | ||
+ | |||
</body> | </body> | ||
+ | </html> | ||
</html> | </html> |
Revision as of 11:57, 28 September 2014