0

I am looking for to mimic the same scroll behavior the new Flickr website has at https://www.flickr.com/#section-1.

No matter how hard or fast you move your mouse scroll wheel the result is the same.

I know this is a kind of parallax website but I am more interested in the scroll control.

This is what I am doing right now using this plugin https://github.com/ultrapasty/jquery-disablescroll:

var mypos = $(window).scrollTop();
var up = false;
var newscroll;
$(window).scroll(function () {
    newscroll = $(window).scrollTop();
    if (newscroll > mypos && !up) {
        $(window).disablescroll(); //disable scroll
        //$('body').addClass('stop-scrolling'); //a css that inputs an overflow hidden
        $('#video_bkg').stop().animate({
            height: 'toggle',
            opacity: 'toggle'
        }, 500);
        up = !up;
    } else if(newscroll < mypos && up) {
        $('#video_bkg').stop().animate({
            height: 'toggle',
            opacity: 'toggle'
        }, 500, function() {
            $(window).disablescroll('undo'); //reenable scroll
        });
        up = !up;
    }
    mypos = newscroll;
});

But none of this equals the Flickr's effect.

2
  • 1
    You should use preventDefault() and stopPropagation() when the mousewheel event is fired. Then you should scroll to the next/prev section depending on mousewheel direction. And also trigger a time counter every time you scroll: this will allow you to avoid change sections too fast. I think that the only jquery plugin you need is mousewheel. I guess you can figure out the code to do that. Commented Aug 8, 2014 at 14:34
  • This is the direction I needed, thanks folk. Commented Aug 8, 2014 at 15:36

1 Answer 1

1

Here's an example that does this using the fullPage jQuery plugin.

Use

$(document).ready(function() {
    $('#fullpage').fullpage();
});

to initialize the script.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.