PDA

View Full Version : Linking to External IFrame


HeadleyGrange
10-29-2005, 07:07 AM
Hello, I need a link that will open a page and display a picture in the IFrame. It needs to be dynamic though becuase i want to be able to click a thumbnail on gallery.html then open picture.html and show the bigger picture in an iframe named "bob", make sense? Is this possible and if it is can it be done using HTML tags? Thanks for any help.

Mr J
10-29-2005, 12:29 PM
is the iframe going to be a fixed size, and are the images the same size?

HeadleyGrange
10-29-2005, 08:07 PM
Yes they are all going to be 500 x 375 or maybe a little smaller becuase the ifram get srollbars and i odn't know how to turn those off with out turning off the main pages scrollbars, but to answer your question yes they will be a fixed size, so it the iframe.

Mr J
10-30-2005, 12:57 PM
Is picture.html being opened in a new window or replacing the current page.

The reason I am asking is because I am wondering if the iframe is necessary when you can have the image shown in picture.html without the use of the iframe.

HeadleyGrange
10-30-2005, 01:27 PM
i guess i could get rid of the iframe and put the image in a table but if you go to www.rebelsrocks.com you will see its all graphic based i just don't want a big site and for people to wait for the site to load every time just to see pictures... ya know? i guess i will just go with the tables. ohh and use IE when viewing please!

Mr J
10-30-2005, 03:27 PM
Give the following a try

main page


<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
<script type="text/javascript">
<!--

function iframePic(p){
window.frames['myiframe'].document.images['mypic'].src=p
}

//-->
</script>

</HEAD>
<BODY>


<img src="pic1_small.jpg" onclick="iframePic('pic1_big.jpg')">
<img src="pic2_small.jpg" onclick="iframePic('pic2_big.jpg')">
<img src="pic3_small.jpg" onclick="iframePic('pic3_big.jpg')">
<img src="pic4_small.jpg" onclick="iframePic('pic4_big.jpg')">

<P>
<iframe name="myiframe" src="picture.htm" width="500" height="375" scrolling="no"></iframe>

</BODY>
</HTML>


picture.htm


<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
</HEAD>
<BODY>

<img name="mypic" src="" width="100%" height="100%">

</BODY>
</HTML>

HeadleyGrange
10-30-2005, 05:56 PM
I just went with the tables, since the graphics are already in temp files then the bandwith should be too bad and i get 1.5tb a year or 100 gig a month... so thats alot... lol, it is working so i will just go with that. i have a small questions i have some html file i want to put in a folder how do i link the images if the images and html files share the parent www (holds index.html) folder? Thanks

Mr J
10-30-2005, 09:33 PM
If your images and html file (imagePage) are in the index.html folder you would link to the images from imagePage as

<img src="pic1.jpg">

If your images are in a folder (imagesFolder) in the index.html folder and the html file (imagePage) is in the in the index.html folder you would link to the images from imagePage as

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

Hope this helps

HeadleyGrange
10-30-2005, 10:43 PM
i think you miss understood me. If the image is ni the imagefolder and i have html files in an html folder but the parent folder is www, index.html is in the www folder, how do you link the images from the image foler to the html files in there html folder. get what i am saying? there 2 folders in the main www foler, ones for graphics the other if for html files (to keep them organized) thanks.

Mr J
10-31-2005, 02:13 PM
Right, so you need to come out of html folder and go into image folder

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

mrruben5
10-31-2005, 09:27 PM
Or you could use an absolute path, put a slash in forward.