Note that there are some explanatory texts on larger screens.

plurals
  1. PODisable scrolling just for user
    primarykey
    data
    text
    <p>I am trying to create a page which cannot be scrolled by the user (means, no mousewheel, no space, no cursor-down etc.). while the site itself stays able to scroll: if a specific event is fired, i.e a button is triggered, the scroll should happen.</p> <p>I have done a little research, not only here on stackoverflow but in different forums. There were rumors that this isn't possible and the way to achieve the disable-scroll-thing would be <code>overflow:hidden</code></p> <p>Well, this is wrong for me: <a href="http://fk-agency.com/" rel="nofollow">http://fk-agency.com/</a></p> <p>Does anyone know how this is done?</p> <p>My personal approach would be:</p> <p>Create a site whichs height is just 100% of the viewport size, then slideIn the other div's by css animation or jQuery. But it seems to hacky to me.</p> <p><strong>EDIT</strong>:</p> <p>I tried it with the <code>overflow:hidden</code> attribute, but got the issue that scrolling won't work.</p> <p>Here is a live example of my project, excluding just the necessary code will follow:</p> <p><a href="http://www.antaw.de/Bewerbung2" rel="nofollow">Example</a></p> <p>And here's one without overflow:hidden</p> <p><a href="http://www.antaw.de/be" rel="nofollow">Example 2</a></p> <p><strong>Edit #2</strong></p> <p>I have no idea why, but suddenly it works.</p> <p>I applied <code>overflow: hidden</code> to <code>body</code> and then used the following script to scroll to an element by specify it's id. All good. Many thanks to lukasgeiter, who mentioned this issue.</p> <p><strong>Script</strong></p> <pre><code>function scroll(target){ // target should be like "#id" $('html, body').animate({ scrollTop: $(target).offset().top }, 500); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload