Scroll to page loading

I am trying to do a 200px page load further using javascript. But I always see that 1 second from above until this scrolls down.

vimoe does this, try scrolling the page after the page loads, http://vimeo.com/49645156

margin-top: -200px .. Gives me this effect, but I can’t scroll the page after the margin is set with a negative number.

Maybe create a jquery solution that will change the upper edge of the body after the page loads, will this work?

This script is currently in use.

function jumpScroll() { window.scroll(0,200); // horizontal and vertical scroll targets } 

I will just call this body script with onload.

+2
jquery
source share
2 answers

Instead of giving fields, why not use the div identifier?

I am sure that you have provided the identifier to the unit that you want to show on top at startup.

just use div id like:

 $(document).ready(function (){ var div= $('#example'); // take your div id $(window).scrollTop(div.offset().top).scrollLeft(div.offset().left); } 
+1
source share

Actually it can be done like this:

1. Load an empty div with the height required for all pages.

2. Reformat the scroll to the desired content. Since this will be the first thing that was done when the page was loaded, before the downloaded content would be invisible.

3. Download the actual content via ajax or with a template.

0
source share

All Articles