Forum Moderators: open

Message Too Old, No Replies

loading images in iframe

without html files for each?

         

jo1ene

7:16 pm on May 3, 2005 (gmt 0)

10+ Year Member



I've looked through posts on iframes but could not find an answer. Is there a way to load images, within an html wrapper, without making html files for each. I have js that will wrap images in html for a popup widow but I'm having trouble converting this idea to use in an iframe. Any ideas?

tedster

12:31 am on May 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When your script generates the html that "holds" an image, what is the final URL of that document - the one in the pop-up window? That's what needs to be in the iframe. The bare uri for an image (no html at all) can also be there, but you sacrifice control of margins/padding that way.

jo1ene

1:52 am on May 4, 2005 (gmt 0)

10+ Year Member



It does a window.open and writes some basic code to it. Basically just html, title and body tags. The issue is that I need to set background colors and a border to the images. IE won't put a background on an iframe or else calling just the image would work just fine. I've been using this for popups:

function Start(URL, WIDTH, HEIGHT)
{
windowprops = "left=50,top=50,width=" + (WIDTH+30) + ",height=" + (HEIGHT+30);
text = "<html><head><title>Preview</title></head><body";
text += "><center><img src='" + URL + "'>";
text += "</center></body></html>";
preview1 = window.open("", "preview1", windowprops, false);
preview1.document.open();
preview1.document.write(text);
preview1.document.close();
}