View Full Version : IFRAME question

09-16-2008, 04:43 PM
Hi Guys, my first post here :)

I am trying to solve a problem with iframes and hope someone can help.

I have a html page with two iframes, the one at the bottom consists of thumbnails which when clicked display a larger image of the thumb in the top iframe. All that works fine.
What I want to know is whether there's a way of making the big image in the top frame also clickable. I want it to open in a new window and display a larger version of it.

09-16-2008, 05:29 PM
Make it a link via the <a> tag and set the styles of it on that page to a fixed dimension, constricting it. Then on the link with the actual image, show it's real height/width.

09-17-2008, 04:39 AM
Not sure if I follow you on that.
This is the code for the frames on the main html file:

<iframe src="/img/pic1.html" name="ImageFrame" width=600 height=448 scrolling=no border="0" frameborder="0" allowtransparency="true" align="center">

<iframe src="thumbs.html" name="ThumbsFrame" width=750 height=75 border="0" frameborder="0" style="position:absolute; top:520px; left:130px" allowtransparency="true">

This is the code for the Thumbs Frame:

<a href="/img/pic1.html" target="ImageFrame"><img src="/thumbs/th_pic1.jpg"></a>

This is the code on the pic1.html file which displays in "ImageFrame":

<img src="/images/pic1.jpg"></a>

09-17-2008, 04:52 AM
If this is the image you want to link and open a new window:

<img src="/images/pic1.jpg">

...you can add highlighted:

<a href="/images/pic1.jpg" onclick="window.open('/images/pic1.jpg');return false;"><img src="/images/pic1.jpg"></a>

Hope that helps.

09-17-2008, 04:59 AM
Got you now! Of course!
Thanks guys!