mercredi 15 juin 2016

Is it possible to make a smooth scroll to part of a webpage, even if the scrolling is disabled?


I have used JS to stop scrolling:

<script>
window.onscroll = function () {
window.scrollTo(0,0);
}
</script>

Added CSS too:

body{
overflow:hidden;
width:100%;
height:100%;
}

The main part of the webpage lies in the 100% height. And the other part ("A") lies below the screen.


All I need is a smooth scroll to this part ("A") of the page on click at a anchor. But still not making the page scroll able with arrow keys.


Aucun commentaire:

Enregistrer un commentaire