Difference between revisions of "Team:Lethbridge HS"
Line 14: | Line 14: | ||
window.alert("helo"); | window.alert("helo"); | ||
+ | function setCookie(cname, cvalue, exdays) { | ||
+ | var d = new Date(); | ||
+ | d.setTime(d.getTime() + (exdays*24*60*60*1000)); | ||
+ | var expires = "expires="+d.toUTCString(); | ||
+ | document.cookie = cname + "=" + cvalue + "; " + expires; | ||
+ | } | ||
+ | |||
+ | function functionBees(){ | ||
+ | |||
+ | setCookie("projectType", "1", 365); | ||
+ | |||
+ | } | ||
+ | function functionBiofilms(){ | ||
+ | setCookie("projectType", "2", 365); | ||
+ | } | ||
+ | jQuery(document).ready(function() { | ||
+ | |||
+ | jQuery(function() { | ||
+ | jQuery('a[href*=#]:not([href=#])').click(function() { | ||
+ | if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | ||
+ | var target = jQuery(this.hash); | ||
+ | target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']'); | ||
+ | if (target.length) { | ||
+ | jQuery('html,body').animate({ | ||
+ | scrollTop: target.offset().top | ||
+ | }, 1000); | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | |||
Revision as of 23:13, 3 September 2015