Difference between revisions of "Team:CCU Taiwan"

Line 189: Line 189:
 
          
 
          
 
         <img src="https://static.igem.org/mediawiki/2018/c/c2/T--CCU_Taiwan--CCUNewAbstract6.jpg" width="100%" hieght="auto">
 
         <img src="https://static.igem.org/mediawiki/2018/c/c2/T--CCU_Taiwan--CCUNewAbstract6.jpg" width="100%" hieght="auto">
 +
 +
<ul  id="pagination">
 +
<li><a href="#section0" class="active"><span></span></a></li>
 +
<li><a href="#section1" class=""><span></span></a></li>
 +
<li><a href="#section2" class=""><span></span></a></li>
 +
<li><a href="#section3" class=""><span></span></a></li>
 +
<li><a href="#section4" class=""><span></span></a></li>
 +
<li><a href="#section5" class=""><span></span></a></li>
 +
<li><a href="#section6" class=""><span></span></a></li>
 +
</ul>
 +
 +
 +
 
<footer class="footer">
 
<footer class="footer">
 
             <a href="http://huitong.com.tw">
 
             <a href="http://huitong.com.tw">
Line 226: Line 239:
 
     popup.classList.toggle("show");
 
     popup.classList.toggle("show");
 
}
 
}
 +
 +
 +
function pagination() {
 +
 +
  var offset = $(document).scrollTop();
 +
  var windowHeight = $(window).height();
 +
  var $body = $('body');
 +
 +
  switch (true) {
 +
    case (offset > (windowHeight * 3.75)):
 +
      $body.removeClass().addClass('page-5');
 +
      break;
 +
    case (offset > (windowHeight * 2.75)):
 +
      $body.removeClass().addClass('page-4');
 +
      break;
 +
    case (offset > (windowHeight * 1.75)):
 +
      $body.removeClass().addClass('page-3');
 +
      break;
 +
    case (offset > (windowHeight * .75)):
 +
      $body.removeClass().addClass('page-2');
 +
      break;
 +
    default:
 +
      $body.removeClass().addClass('page-1');
 +
  }
 +
}
 +
 +
pagination();
 +
 +
$(document).on('scroll', pagination);
 +
 +
$(document).on('click', 'a[href^="#"]', function(e) {
 +
    e.preventDefault();
 +
    $('html, body').animate({
 +
        scrollTop: $($.attr(this, 'href')).offset().top
 +
    }, 500);
 +
});
  
 
</script>
 
</script>

Revision as of 09:57, 17 October 2018