Roll page after loading $ (document) with jQuery [duplicate]

0

How to automatically scroll the page gently to 400 pixels below the top when loading the page with jQuery with scrollTop (); ?

<script>
    $(document).ready(function(){
        // ROLAR A PAGINA
    });
</script>
    
asked by anonymous 27.08.2018 / 07:04

1 answer

0

I solved it like this:

<script>
    $(document).ready(function(){
        $('html, body').animate({
            scrollTop: 320
        }, 1600);
    });
</script>

When you load the page, it automatically rolls 320 pixels down smoothly at 1600ms.

    
27.08.2018 / 07:12