Team:SYSU-Software/hm-overview.js
From 2014.igem.org
(Difference between revisions)
Huangmin1012 (Talk | contribs) |
Huangmin1012 (Talk | contribs) |
||
Line 19: | Line 19: | ||
setTimeout(function(){ | setTimeout(function(){ | ||
wheel = true; | wheel = true; | ||
- | }, | + | }, 800) |
} | } | ||
}); | }); | ||
} | } |
Revision as of 13:05, 17 October 2014
window.onload = function(){ var count = parseInt(window.location.hash.slice(-1)), wheel = true; document.getElementById('showpics').className = 'rotate'; count = (count>0 && count<5)? count : 1; document.getElementById('bodyContent').className="hm-part"+count; $(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; }, 800) } }); }