Jump to content

Any Ideas? Load Center-Content Last?


NeoMarine

Recommended Posts

Any Ideas?

 

I have a layout which contains a header, left vertical rule, center-content, right vertical rule and footer - in that order (same loading order, also).

 

The vertical rules are left/right of the center-content, the header is at the top and footer below everything else.

 

Essentially, I would like the center-content to actually "load" last. I'm thinking, if this is not possible through a realistic~css~layout, perhaps there is a method with AJAX/javascript - in which I would be all ears for that and any ideas you have!

 

Thank you!

Link to comment
Share on other sites

Well, the thing I would be worried about is loading the content through AJAX because it would cause Google to be unable to index that content.

 

Perhaps if I use <noscript> in combination, where inside <noscript></noscript> I output the exact same content I would with "onload=ajaxScript();" type functionality?

 

@dropfaith

 

I'd like to show a "loading content" display for the center-content... also, I'd like the "framework" to load, and then the "content" so my site looks as professional as possible. ~just trying to add a little spark* to my web development.

Link to comment
Share on other sites

flash hrmm im not sure you can use a flash element like that

 

some other options

<meta name="refresh" content="10;page2.html"> 

will load a page you can design how you like then redirect to page2.html after 10 seconds

 

 

you could use a php call before any of the first opening html tag (or declaration)

 

<?php
sleep(10);
?>

where '10' is 10 seconds.

 

 

 

The javascript code to invoke a function after 10 seconds is:

 

setTimeout( function() { /* update div code here */ }, 10000);

 

To get that to run when the page loads do:

<script type="text/javascript">
window.onload = setTimeout( function() { /* update div code here */ }, 10000);
</script>

 

okay my last option i will give here

<Html>
<head>
<script type="text/javascript">
var Interval;

function delay() {
  Interval=window.setInterval("document.write('another message')", 2000);
  // function will be called every 2 seconds
  // Note that you can add any parameters to the function call.
}


</script>
</head>
<body onload="delay()">
</body>
</html>

Link to comment
Share on other sites

One way around this is to add the content at the very bottom of your page, then position it relatively in the area where you will want it to be.

 

However, this is very difficult if not impossible to get to work. There are a few reasons. First, you will have to leave a space the size of the element for it to be positioned into. So if you have a non-fixed layout it won't work. Also, since you have a footer on your page, you will have to fix the height of the content div, which may not work so well for you.

 

It's an idea you can potentially try to work with, but I'm guessing you probably won't be able to get it work right.

Link to comment
Share on other sites

 

 

I'd like to show a "loading content" display for the center-content... also, I'd like the "framework" to load, and then the "content" so my site looks as professional as possible. ~just trying to add a little spark* to my web development.

 

this line states his intention loading the content relitive would not be enough he needs a javascript to delay it with the loading icon he is using

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.