-2

I have an idea for an website which needs this kind of technique. It's compared to the fade-in technique but in my opinion this fits the design better. Is there anyway to disable scroll options and only scroll to an anchor when its button is clicked. If anyone got a link to a tutorial it would be really helpfull as I can't get it clear myself.

JustinDD
  • 1
  • 1
  • You could make your page non scrollable (the same size as the screen) and then handle the down and up arrows using JavaScript. You could then change the page content using JS. – Sumner Evans Mar 09 '15 at 13:16
  • Related: http://stackoverflow.com/questions/10313142/javascript-capture-mouse-wheel-event-and-do-not-scroll-the-page – blgt Mar 09 '15 at 13:16
  • Doesn't work for me.. – JustinDD Mar 09 '15 at 13:22

1 Answers1

0

To disable scroll options, you can use the css overflow rule like this:

overflow-y:hidden;

To add function to your buttons, you'll have to use js event listeners that are set to listen for clicks:

document.getElementById("t1").addEventListener("click", scrollDown);

After that, you can use javascript or jquery to scroll the page to whatever anchor depending on page position/clicks that have already happened etc.

Here's a thrown together jsFiddle of what it sounds like you're trying to do: JsFiddle

I use a lot of divs in that example, but the only important thing for function is the id of elements used.

Hope this helps!

skrawler
  • 119
  • 3