Forum Moderators: not2easy

Message Too Old, No Replies

Should I replace iframe for loading a photo when thumbnail is clicked?

         

madmartian

11:28 pm on Sep 25, 2008 (gmt 0)

10+ Year Member



My old web site has a table for layout and an iframe in one of the cells for loading a photo when a thumbnail is clicked on in another cell. I am converting my layout to CSS and was wondering - is the iframe still necessary or can the effect be done using only CSS (without loading the large photos in advance)? If not, is there a javascript solution? Or should I just keep using iframe? I also need to be able to load an HTML document into the frame rather than just a photo, which I can with iframe.

swa66

11:18 am on Sep 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An iframe is just that: a way to load a different page in a rectangle.
There are typically measures in place to prevent scripting from the surrounding site to touch the content of the iframe (to prevent all sorts of attacks)

Javascript can change content of the document itself, try the javascript forum for more info. It's not that impossible to control
which images get preloaded etc.

CSS typically causes the browser to load the images you touch.

madmartian

9:06 pm on Sep 26, 2008 (gmt 0)

10+ Year Member



I found on another site the use of the OBJECT tag, which appears to work great with height=100% on all CURRENT browsers. Is there any reason I should NOT use the OBJECT tag in place of an iframe?

<object height="100%" width="100%" id="show" name="show" data="products/prod_angle.htm" type="text/html"></object>

madmartian

11:54 pm on Sep 26, 2008 (gmt 0)

10+ Year Member



Argh! I spoke too soon! Works wonders in FF and Safari, but IE opens all the links in a new window. Apparently the ID and NAME tags do not work for a link's TARGET in IE. :(