tags:

views:

1294

answers:

7

Here's a lowly HTML question...

I have a large, hi-def JavaScript-intensive image banner for a site I'm designing. What is everyone's opinion of using IFrames so that you incur the load time only once? Is there a CSS alternative to the IFrame?

feel free to preview the site at http://csm.dev11.com

It is very much a work in progress.

Thanks,

KN

A: 

I find the main challenge with iFrame headers is resizing. Since the font in your header is of static size, I don't see a problem with using an iFrame. Although I'm not sure if it's really intensive enough to be worth it.

Eugene Katz
A: 

Well, the browser appears to cache all seven banner images upon the first load, and runs them out from the cache (for each subsequent page) thereafter. I don't think you have a problem :D

Try it out with Firebug's Net monitoring tool in Firefox.

mercutio
A: 

I should also have mentioned that I would like the banner rotation to keep moving. When the visitor clicks on a link, the banner rotation starts over. It would be nice if the "animation" kept rotating, regardless of the page the user visits.

KN

Kyle Noland
A: 

While using IFrames as a sort of master page/template for your pages might be a good thing, IFrames have a known negative impact to searchability/SEO.

It might also be unnecessary in the first place because once your images are loaded the first time (and with the large high-def images you have on your site, that would be slow no matter what you do) the images are cached by browsers and will not be reloaded until the user clears their cache or does a Ctrl-F5.

Jon Limjap
A: 

This may work without CSS also, but if you use CSS to load the background and your server is configured correctly, the image should already only be downloaded once.

Usually the browser will request a resource by asking for it only if it has not been modified since the last time it was downloaded. In this case, the only things sent back and forth are the HTTP headers, no content.

If you want to ensure the image is only downloaded once, add an .htacces or an apache2.conf rule to make the image expire a few days into the future so that users will only request it again if their cache is cleared or the content expiration date passes. An .htaccess file is probably too excessive to use in your case, though results may vary.

Dan Herbert
A: 

I should also have mentioned that I would like the banner rotation to keep moving. When the visitor clicks on a link, the banner rotation starts over. It would be nice if the "animation" kept rotating, regardless of the page the user visits.Blockquote

Well, in that case I would strongly recommend not doing that. The only real way of achieving that is to have the actual website content in the iframe, which means that you suddenly have lots of negative sides to the site: not being able to bookmark urls easily due to the address bar not changing; accessibility concerns; etc

I think you'll find that most people won't care that it reloads again. Once a visitor lands on your website, they'll marvel at the wonderful banner immediately, and then will continue to ignore it while they browse your site - until an image they haven't seen appears and distracts them away from your content.

Keep the rotation random enough, and with enough images, and people will stop to look at it from whatever page they're on.

mercutio
A: 

you could have it load the main page once, then asynchronously load the other elements when needed (ajax). If you did that, an iFrame would not be necessary. Here is an example of loading only the new material: http://www.dubioussecurity.com

Ed