The Straight Dope

Go Back   Straight Dope Message Board > Main > General Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-21-2006, 12:23 PM
Eonwe Eonwe is online now
Charter Member
 
Join Date: May 2000
Location: Burlington VT
Posts: 7,048
IFrames: good technique?

This is a quick question for the web design folks here.

I'm very used to the concept that frames are generally a bad idea when it comes to site design and layout. Lately, though, it seems that inline frames are being used a fair amount. Is this "good" practice?

Would an iframe be an appropriate tool to, say, load images into as part of a photo gallery (where the page with thumbnails stays constant, and a thumbnail click loads a new photo page into the iframe)?

It's just strange to see folks talking about frames all of a sudden, when they had been verbotten for so long.
Reply With Quote
Advertisements  
  #2  
Old 11-21-2006, 12:28 PM
friedo friedo is online now
Charter Member
 
Join Date: May 2000
Location: Brooklyn
Posts: 20,441
No, very bad practice.

Typically the only place you'll see iframes used on well-designed sites is for loading advertising from an external source. Even then they're still a pain in the ass.

For a photo gallery, all you need is a table of images, or better yet some really cool CSS layout design.
Reply With Quote
  #3  
Old 11-21-2006, 12:47 PM
ZipperJJ ZipperJJ is offline
And Finn The Human
Charter Member
 
Join Date: Aug 2001
Location: Northeast Ohio
Posts: 18,557
You'll run into some of the very same problems we discussed in that other thread about frames (it's in GQ - sorry can't find it now) last week. It's still a page that can't stand on it's own so you will run into search engine problems unless you do some good work with robots.txt. But then you lose out on a lot of access to your site.

As far as I know, it would also have the same accessibility problems for text readers.

We use it on some of our sites on pages that we need to be able to post/submit data but don't want the user to be taken away from the main page. But this can also be accomplished with javascript and XML using a "silent post" which is what we're moving towards now.

But you know, if you have a personal site and want to display some photos, then what does it matter? Or even if you have a professional site and the client is aware of the limitations and implications of using an iframe, what does it matter? You'll note on that site that friedo links to, the images all need to be loaded before they can display so you see (or at least I do) a lot of broken images for a bit until everything is set. Is that really better?
Reply With Quote
  #4  
Old 11-21-2006, 12:55 PM
Eonwe Eonwe is online now
Charter Member
 
Join Date: May 2000
Location: Burlington VT
Posts: 7,048
Quote:
Originally Posted by friedo
No, very bad practice.

Typically the only place you'll see iframes used on well-designed sites is for loading advertising from an external source. Even then they're still a pain in the ass.

For a photo gallery, all you need is a table of images, or better yet some really cool CSS layout design.
Cool, thanks. I was wondering why they all of a sudden seemed so popular; it seems that the same problems with frame tags would still (mostly) apply with iframes.

Nice link. That site has some nice looking stuff on it. I'm actually working on a photo gallery/order form, and am doing it with css and changing the z-index of divs containing the different images (and using php to generate the page based on available images).
Reply With Quote
  #5  
Old 11-21-2006, 01:04 PM
Eonwe Eonwe is online now
Charter Member
 
Join Date: May 2000
Location: Burlington VT
Posts: 7,048
Quote:
Originally Posted by ZipperJJ
We use it on some of our sites on pages that we need to be able to post/submit data but don't want the user to be taken away from the main page. But this can also be accomplished with javascript and XML using a "silent post" which is what we're moving towards now.

But you know, if you have a personal site and want to display some photos, then what does it matter? Or even if you have a professional site and the client is aware of the limitations and implications of using an iframe, what does it matter? You'll note on that site that friedo links to, the images all need to be loaded before they can display so you see (or at least I do) a lot of broken images for a bit until everything is set. Is that really better?
The idea is that the user will go to a photo gallery. In that gallery is a bunch of thumbnails. The user clicks on a thumbnail, which brings up a full sized image, as well as some text and a form (which has some unique vaules in hidden items related to the image name) that can be submitted. I'm not that concerned with the user being able to find or link to any given image, just the gallery itself.

I am slightly concerned about having to pre-load. I'm guessing that with all the full sized images that a page would, with pre-loading, be around 200-300k, which makes me a bit uncomfortable.
Reply With Quote
  #6  
Old 11-21-2006, 02:17 PM
ZipperJJ ZipperJJ is offline
And Finn The Human
Charter Member
 
Join Date: Aug 2001
Location: Northeast Ohio
Posts: 18,557
Quote:
Originally Posted by Eonwe
I am slightly concerned about having to pre-load. I'm guessing that with all the full sized images that a page would, with pre-loading, be around 200-300k, which makes me a bit uncomfortable.
So in this case it seems like iframes are the way to go, no?

"Always do everything 100% in CSS" is not a rule to live by. You have to consider the implications of it for each individual project. Do you want to load pics and forms one at a time or 100 at a time?

Don't be afraid to do something on a Web site just because someone says it's not right. You be the Web pro - you decide what's right for your client.
Reply With Quote
  #7  
Old 11-21-2006, 04:32 PM
Khadro Khadro is offline
Guest
 
Join Date: Sep 2001
I am one of those people who likes to use pure CSS layouts where i can, but it's not always possible.

At work, we use Iframes on our web interface, for the data load issue. We need to refresh and reload several data sets every two minutes (staggered so not everything is loading at the same time), and don't want to reload the entire page every time. So we used Iframes, and wrapped them in resizable, movable elements to make a windows-like interface. It works well enough there, and I think it's justified by having several hundred Kb of data loading from several sources all at once. There's the main interface, the contextual menus based on the data being returned by the main interface, graphs, reports, charts etc... all live from (up to 120) external machines.

I have never used them outside of this however, as they are deliciously hard to work with in a cross-browser environment. Especially if you don't want them to look like Iframes. Also, a lot of that work could have been done using Ajax and loading data in the background after the page had loaded. And in fact we are looking into doing just that for the next version (when I get time to spec it out).

For your gallery, if the thumbnails exist separately to the main gallery images, there's no reason you could not load all the thumbnails, and then after the page is loaded go and load all the images in a hidden element somewhere. Then simply show them when required.

I also echo what ZipperJJ said. Just because someone else tells you it's not right, does not make it so. If every web site were done "right" they'd all look the same, no? If you were to take into account all the Web Standards, Accessibility, Scripting, Cross-browser issues, and tried to make the perfect site, you'd be crafting it forever. You know your market (I hope ), and you know what can be borne by them. So craft your site and interface accordingly.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:43 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Send questions for Cecil Adams to: cecil@chicagoreader.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Publishers - interested in subscribing to the Straight Dope?
Write to: sdsubscriptions@chicagoreader.com.

Copyright 2013 Sun-Times Media, LLC.