Team:SYSU-Software/hm-overview.js

From 2014.igem.org

Revision as of 15:51, 16 October 2014 by Huangmin1012 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
   window.onload = function(){
       var count = 1,
           wheel = true;
       document.getElementById('showpics').className = 'rotate';
       document.getElementById('bodyContent').className="hm-part1";
       $(window).mousewheel(function(e, delta){
           if(wheel){
               wheel = false;
               if(count==1 && delta>0){
                   count=1;
               } else if(count==4 && delta<0){
                   count=4;
               } else {
                   delta > 0 ? count-- : count++;
                   count = count%4 || 4;
               }
              document.getElementById('bodyContent').className = 'hm-part'+count;
               setTimeout(function(){
                   wheel = true;
               }, 1500)
           }
           
       });
   }