开发者

How to make the web page to download bottom to up?

Every web page load from top to bottom means first my header will be loaded then content and finally footer. How can i make it to load from bottom to up.means f开发者_如何学Cirst footer then content and then finally header content. Are you getting what i am trying to say.?? OR to make it load from right to left OR left to right..


This is probably one of the more bizarre questions I've seen here...

You cannot change the order in which the browser loads the file, it will always start at the beginning and read to the end. However, if you change the order of the file such that the footer is first and the header is last, the browser will render it in that order. As long as the CSS places each element in the correct place, it should work.

This will probably have some strange side effects since the browser will have to rerender or move elements several times as it moves the footer down the page to make room for the elements above it.

Is there really a need for this? Web pages generally load fast enough that users won't notice what direction they load in, and if your page isn't loading that fast, then I would focus on finding out why instead of trying to render it in a different order.


A web page is HTML + additional files.

The HTML file is loaded and read start-to-finish. When it gets to a point in the file where it requests another file (such as CSS, .JS, an image, etc.) it then sends a request to get that image.

You have control over that in that you can rearrange your HTML any way you want to.

What you don't have control over is how long it takes to request and then retrieve each of the individual files.

If you want full control, then you pretty much need to load everything but keep it hidden, and then reveal the items in the order you want them to appear via javascript and CSS.

All that said, though, the better answer is "No. You can't. That's just how the web works".


If this is for some kind of cool effect on your page, you could check out Page Transitions. These only work in IE though. If that is the case, it looks like you want the Wipe effect.


If you want it to just look like its loading from bottom to top then you could hide everything with css in the header and then have javascript unhide them starting from the bottom of the page - but I really don't know why you'd want to do this. Can you give us some more information on the effect you're trying to create?


Visually, you could get the sort of effect where one would see the content before the header by putting the header after the content in the HTML output then use CSS to make the header appear first visually.

If you want to scroll your content in somehow, I'd check out jquery and animations.


Assumption 1: Load content before styles/javascript.

In this assumption you care about the page loading first THEN the css/javascript executing thus allowing the user to get the content before all scripts/styles load and thus speed up the usability of the page.

To accomplish this put the style/script tags as the last elements in your body.

Assumption 2: Bizarro-world loading.

In this assumption you want the footer loaded/displayed first, then content, then header in that exact order.

1) The html head element will load before the body. No way to change that. Header = page header in my wording.

2) Use the following html pseudocode

<html>
    <head></head>
    <body>
        <div id="footer"></div>
        <div id="content"></div>
        <div id="header"></div>
    </body>
</html>

And in your css float everything to the right having them take up 100% width. This will cause the page to load backwards but when it is displayed it will be displayed appropriately.

#header,#footer,#content { width: 100%; float: right; }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜