Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sectionScroll() {
- var section = $('section');
- var down = 0;
- section.bind('DOMMouseScroll', function(e){
- if(e.originalEvent.detail > 0) {
- //scroll down
- if ((down >= 0) && (down < 8))
- {
- down++;
- }
- } else {
- //scroll up
- down--;
- if (down < 0) {
- down = 0;
- }
- }
- //prevent page fom scrolling
- sectionShow(down);
- liActive(down);
- return false;
- });
- //IE, Opera, Safari
- section.bind('mousewheel', function(e){
- if(e.originalEvent.wheelDelta < 0) {
- //scroll down
- if ((down >= 0) && (down < 8))
- {
- down++;
- }
- // console.log('Down', down);
- }else {
- //scroll up
- down--;
- if (down < 0) {
- down = 0;
- }
- }
- up = down;
- //prevent page fom scrolling
- sectionShow(down);
- return false;
- });
- }
- //Firefox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement