Click to See Complete Forum and Search --> : preloaded or hidden pages


chuvak
06-23-2003, 11:28 AM
Hi,

I need to create a page with some tabs so that when I press a certain tab, the content for that tab appears immediately without flickering. I've been told that it is posible to do with preloaded frames making all but one invisible, or hide and show content with css.

Can anybody give a small example of how to do that (preferably with CSS)?

thanks in advance

DaveSW
06-23-2003, 11:37 AM
Preload images by putting them on a previous page and using the css display:none; property.

e.g

<img src="" width="" height="" style="display:none">

That means they don't display, but are downloaded to the cache. They will then display quickly when they are next called.

chuvak
06-23-2003, 11:49 AM
I didn't mean images but rather the whole page or a frame.
Can I do the following

<div class="c1">...</div>
<div class="c2">...</div>
<div class="c3">...</div>

and manipulate display property to show only one of them at a certain time?
If only one is displayed at a time, is it going to always be displayed at one place, that is if I only show "c3" it's not going to show up way down as if I was showing all three of them, right?

thanks

DaveSW
06-23-2003, 11:51 AM
You can put that style="display:none;" in any tag you like. However, text downloads almost instantly, so you really only need it for images.

DaveSW
06-23-2003, 11:54 AM
Regards the second part of your q (missed it the first time I read it)

an iframe is the best way to do it. Otherwise you are probably going to use javascript, and that makes your site inaccessible to 13% of users. Just put the content of the other iframe pages at the bottom of each page.

Maybe you could use javascript to control the download order?

chuvak
06-23-2003, 12:26 PM
Thing is, nobody is going to access these pages over the web. They are configuration pages for a browser, so the download time is a fraction of a second, but there is still a flicker every time I go to another url.
That's why I wanted to have everything preloaded and just hide/show things.
I can use javascript if necessary (plenty of it already on those pages).

Could you explain how to do it with iframes?

thanks in advance

DaveSW
06-23-2003, 12:36 PM
If it's coming directly off a hard drive there won't be much of a difference between preloaded or not. Maybe you'd be better adding a page transition??

Anyway

iframes

<iframe src="framecontent1.htm" frameborder="0" style="width:XXpx; height:XXpx;"><a href="framecontent1.htm>contents</a></iframe>

You'll need one page for each div. then put the links alongside.
Then put just the content to be preloaded onto the bottom of each new page for content. (and use display:none)

OK?

pyro
06-23-2003, 12:47 PM
If the possibility of javascript being disabled really isn't a consideration, you might want to look at http://www.infinitypages.com/research/clientsidedivinclude.htm