Force user to scroll 100%

Swaggots

Member
Sep 22, 2013
98
18
So I have this website divided into 2 sections. Both sections are 100% width and 100% height. Scrollbar is hidden.
Section A is the first one, and is show when the page is loaded. I'd like it that whenever the user barely scrolls using their scroll wheel or trackpad, Section B is shown directly. That way, the user wouldn't be allowed to scroll through the website manually, but a little scroll would cause them to scroll 100% of the window height.

Sort of what MEGA has going on (ex: ).
See how when you barely scroll the second section is instantly show? Couldn't really find a tutorial for this online.

Thanks a lot for the help.
 

Jemz

xmas tings.
Aug 6, 2013
166
17
Code:
$(window).scroll(function (event) {
   $('body').scrollTo('#target');
});

I don't know if scrollTo is still a jquery func or not if not use
 

Swaggots

Member
Sep 22, 2013
98
18
Code:
$(window).scroll(function (event) {
   $('body').scrollTo('#target');
});

I don't know if scrollTo is still a jquery func or not if not use

Does not work.
Code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
        <script>
            $(window).scroll(function (event) {
               $('body').scrollTo('.section');
            });
        </script>
 

Jemz

xmas tings.
Aug 6, 2013
166
17
Does not work.
Code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
        <script>
            $(window).scroll(function (event) {
               $('body').scrollTo('.section');
            });
        </script>

EDIT: Tried using the bind event to listen for the mousewheel instead and it worked as in it goes up and down.
 
Last edited:

Swaggots

Member
Sep 22, 2013
98
18

EDIT: Tried using the bind event to listen for the mousewheel instead and it worked as in it goes up and down.

Thanks a lot, second one seems to work both up and down. Only problem is that it fucks up with my mac trackpad, any ideas?
 

brsy

nah mang
May 12, 2011
1,530
272
If you're doing this, be sure to add a "dot navigation" on the bottom or side of the page, so users can see what's happening. Scroll hijacking can be very bad if you don't implement things like I stated above.
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
I don't know why you'd want this, the effect it gives off is good but it is highly fucking annoying.

I've just visited the link to MEGA you've posted and got so annoyed with it. Glad I don't use that service.
 

Swaggots

Member
Sep 22, 2013
98
18
I don't know why you'd want this, the effect it gives off is good but it is highly fucking annoying.

I've just visited the link to MEGA you've posted and got so annoyed with it. Glad I don't use that service.

It's just a 2-section page where each section is 100% width and 100% height. I don't see the point in the user being able to scroll for themselves, so I might as well just implement this so they can easily jump from section to section.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,132
2,456
I'd still keep the scrollbar. If people want to use the easy method, they can just scroll. If people want to scroll for themselves, they still can. Some people want to atleast have the option of controlling it yourself.
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
If I were you, I'd have it so people who use their scrollbar have the default scrolling effect you'd usually see, but people using arrow keys (obviously up + down) will have the force-scroll effect.

I use the Magic Trackpad for iMac so it's fucking annoying because of how sensitive it is.
 

Users who are viewing this thread

Top