Team:Alberta/Templates/Header

From 2012.igem.org

(Difference between revisions)
Line 214: Line 214:
     $(menu). offset({top: 100 + 30 * $('.headerMenu').index($(parent) )} );
     $(menu). offset({top: 100 + 30 * $('.headerMenu').index($(parent) )} );
      
      
 +
}
 +
 +
$('li').click( function() {
 +
 +
alert($('li').index(this));
 +
 +
});
 +
 +
function writeCookie(name,value,days) {
 +
    var date, expires;
 +
    if (days) {
 +
        date = new Date();
 +
        date.setTime(date.getTime()+(days*24*60*60*1000));
 +
        expires = "; expires=" + date.toGMTString();
 +
            }else{
 +
        expires = "";
 +
    }
 +
    document.cookie = name + "=" + value + expires + "; path=/";
 +
}
 +
 +
function readCookie(name) {
 +
    var i, c, ca, nameEQ = name + "=";
 +
    ca = document.cookie.split(';');
 +
    for(i=0;i < ca.length;i++) {
 +
        c = ca[i];
 +
        while (c.charAt(0)==' ') {
 +
            c = c.substring(1,c.length);
 +
        }
 +
        if (c.indexOf(nameEQ) == 0) {
 +
            return c.substring(nameEQ.length,c.length);
 +
        }
 +
    }
 +
    return '';
}
}
</script>
</script>

Revision as of 14:59, 26 September 2012