Difference between revisions of "Team:UNITN-Trento/Test"

m
Line 7: Line 7:
 
<script src="https://2015.igem.org/Template:UNITN-Trento/JSPapaParse?action=raw&ctype=text/javascript"></script>
 
<script src="https://2015.igem.org/Template:UNITN-Trento/JSPapaParse?action=raw&ctype=text/javascript"></script>
 
<script src="https://2015.igem.org/Template:UNITN-Trento/JSscrollTo?action=raw&ctype=text/javascript"></script>
 
<script src="https://2015.igem.org/Template:UNITN-Trento/JSscrollTo?action=raw&ctype=text/javascript"></script>
 +
<script src="https://2015.igem.org/Template:UNITN-Trento/JSnotebookFunctions?action=raw&ctype=text/javascript"></script>
 
 
 
<link rel="stylesheet" type="text/css" href="http://www.startrekfederation.it/transfer_area/timeline.css?action=raw&ctype=text/css" />  
 
<link rel="stylesheet" type="text/css" href="http://www.startrekfederation.it/transfer_area/timeline.css?action=raw&ctype=text/css" />  
Line 83: Line 84:
 
 
 
 
});
+
});
+
function showBlocks(blocks, offset) {
+
blocks.each(function(){
+
( $(this).offset().top <= $(window).scrollTop()+$(window).height()*offset && $(this).find('.cd-timeline-img').hasClass('is-hidden') ) && $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
+
});
+
}
+
function scrollandfade(ida)
+
{
+
var LCLtimelineBlocks = $('#'+ida+' .cd-timeline-block');
+
+
$('.button.active').removeClass('active');
+
$('#'+ida+'_btn').addClass('active');
+
+
$('#'+ida).siblings().css('display','none');
+
$('.cd-timeline-img, .cd-timeline-content').removeClass('bounce-in').addClass('is-hidden');
+
+
$(window).on('scroll', function(){
+
+
(!window.requestAnimationFrame)
+
? setTimeout(function(){ showBlocks(LCLtimelineBlocks, 0.8); }, 100)
+
: window.requestAnimationFrame(function(){ showBlocks(LCLtimelineBlocks, 0.8); });
+
});
+
+
+
$('#'+ida).fadeIn(100,function(){
+
$('body').scrollTo('#main',{axis: 'y',duration: 350,margin:true,offset: -80});
+
});
+
+
+
return false;
+
}
+
 
</script>  
 
</script>  
  

Revision as of 19:48, 9 August 2015