Team:Heidelberg/js/notebook

From 2014.igem.org

(Difference between revisions)
Line 15: Line 15:
updateToTimestamp = function(timestamp) {
updateToTimestamp = function(timestamp) {
   var $week = $('#innerWrapper .'+selectedProject).filter(function(){
   var $week = $('#innerWrapper .'+selectedProject).filter(function(){
-
     return ($(this).data("timestamp") >= timestamp) && ($(this).data("timestamp")+604800 > timestamp);
+
     return ($(this).data("timestamp") <= timestamp) && (timestamp < $(this).data("timestamp")+604800);
   }).get(0);
   }).get(0);
   $('#outerWrapper').stop(true);
   $('#outerWrapper').stop(true);

Revision as of 20:18, 13 October 2014

var projects = {

 dnmt1 : "DNMT1 description",
 lov: "LOV Domain description",
 lysozyme : "Lysozyme description",
 standards: "Standards description",
 toolbox: "Toolbox description"

}

var selectedProject = "dnmt1";

scrollToElement = function(id){ $('#outerWrapper').animate({scrollTop: $('#'+id).offset().top - $('#innerWrapper').offset().top}, 1500, "easeInOutCubic"); }

updateToTimestamp = function(timestamp) {

 var $week = $('#innerWrapper .'+selectedProject).filter(function(){
   return ($(this).data("timestamp") <= timestamp) && (timestamp < $(this).data("timestamp")+604800);
 }).get(0);
 $('#outerWrapper').stop(true);
 $('#outerWrapper').animate({scrollTop: $week.offset().top - $('#innerWrapper').offset().top}, 1500, "easeInOutCubic");

}

$(document).ready(function(){

 $(".titles span").click(function(event){
   $('.titles span').removeClass("active");
   $(event.target).addClass("active");
   $('#project-description').html(projects[event.target.id]);
 });

});