Team:USTC-Software/main.js

From 2014.igem.org

(Difference between revisions)
 
Line 18: Line 18:
});
});
});
});
-
 
-
 
-
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
 
-
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
 
-
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
 
-
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 
-
 
-
  ga('create', 'UA-35866682-3', 'igem.org');
 
-
  ga('send', 'pageview');
 

Latest revision as of 03:38, 18 October 2014

jQuery(document).ready(function($){ var $timeline_block = $('.cd-timeline-block');

//hide timeline blocks which are outside the viewport $timeline_block.each(function(){ if($(this).offset().top > $(window).scrollTop()+$(window).height()*0.75) { $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden'); } });

//on scolling, show/animate timeline blocks when enter the viewport $(window).on('scroll', function(){ $timeline_block.each(function(){ if( $(this).offset().top <= $(window).scrollTop()+$(window).height()*0.75 && $(this).find('.cd-timeline-img').hasClass('is-hidden') ) { $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in'); } }); }); });