The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

dynamically resizing contents to fit a fixed sized iframe

2 posters

Go down

dynamically resizing contents to fit a fixed sized iframe Empty dynamically resizing contents to fit a fixed sized iframe

Post by DUM4S5 August 4th 2009, 12:37 am

basically i have array of images that i have successfully rotating as a banner on my site. I am usiing an iframe to present the banner. I wish to create another, but smaller iframe, using the same source of images but scaled down proportionally to fit the second iframe.

I have access to the javascript array if i need to edit it. Any edits to this will need to leave the original banner in the same state as it is now.
avatar
DUM4S5
New Member

Posts : 5
Reputation : 0
Language : English

http://www.haloramics.com

Back to top Go down

dynamically resizing contents to fit a fixed sized iframe Empty Re: dynamically resizing contents to fit a fixed sized iframe

Post by RoNo August 4th 2009, 1:44 am

You could create a 2nd Html page for a smaller image array.
Resize the images for the 2nd array to (for example) width=150, height=60
Reference it (as you do for slide show array #1) in a 150X60 iframe

This is your array (added size properties: width=150 height=60)
Code:
<center><body bgcolor="262626"><script language="JavaScript"><!--

//Javascript Created by Computerhope http://www.computerhope.com

//store the quotations in arrays, last modified by AmX15 on June 26 =]

//DO NOT ALLOW IMAGES FROM PHOTOBUCKET!  THEY GET DELETED AFTER AWHILE!

images = new Array(52);

images[0] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/untitl10.png' width=150 height=60 border=0 alt='Haloramics'></a>";

images[1] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/2iudg510.jpg' width=150 height=60 border=0 alt='Haloramics'></a>";

images[2] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/untitl11.png' width=150 height=60 border=0 alt='Haloramics'></a>";

images[3] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/216l2x10.jpg' width=150 height=60 border=0 alt='Haloramics'></a>";

images[4] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/1572bl10.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[5] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/i5td7410.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[6] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/ojf9yt10.jpg width=150 height=60 border=0' border=0 alt='Haloramics'></a>";

images[7] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/3df5hg10.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[8] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/halora10.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[9] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/halora11.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[10] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/halora12.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[11] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/halora13.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[12] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/halora14.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[13] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/techni10.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[14] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/halora15.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[15] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/banana10.png' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[16] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/panora10.png' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[17] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/110.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[18] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/210.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[19] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/310.jpg' border=0 alt='Haloramics'></a>";

images[20] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/410.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[21] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/510.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[22] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/610.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[23] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/710.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[24] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/banner10.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[25] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/theark11.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[26] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/halora16.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[27] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/hr10.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[28] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/banner11.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[29] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/sunset10.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[30] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/teabag12.gif' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[31] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/halora17.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[32] = "<img src='http://farm4.static.flickr.com/3645/3456057683_cfb5d9c196_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[33] = "<img src='http://farm4.static.flickr.com/3523/3456050389_f66d052907_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[34] = "<img src='http://farm4.static.flickr.com/3527/3456859052_db45437f47_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[35] = "<img src='http://farm4.static.flickr.com/3638/3456850924_6488cda46f_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[36] = "<img src='http://farm4.static.flickr.com/3568/3456025899_3e4cea26d1_o.jpg' border=0 alt='Haloramics'></a>";

images[37] = "<img src='http://farm4.static.flickr.com/3480/3455986947_15c4907590_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[38] = "<img src='http://farm4.static.flickr.com/3567/3456803504_14c4aa2432_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[39] = "<img src='http://farm4.static.flickr.com/3659/3486456645_6718923d7e_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[40] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/ark10.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[41] = "<img src='http://i87.servimg.com/u/f87/13/57/38/00/banner10.png' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[42] = "<img src='http://img242.imageshack.us/img242/9671/wowesomebanner.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[43] = "<img src='http://farm4.static.flickr.com/3633/3500912699_62d72216ef_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[44] = "<img src='http://i39.tinypic.com/ifo4sp.png' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[45] = "<img src='http://i42.tinypic.com/qs4k6f.png' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[46] = "<img src='http://i44.tinypic.com/2hpriab.png' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[47] = "<img src='http://farm4.static.flickr.com/3310/3510146716_c28f02466a_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[48] = "<img src='http://farm4.static.flickr.com/3605/3509336333_bde3867644_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[49] = "<img src='http://farm4.static.flickr.com/3663/3509336303_d97857cae6_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[50] = "<img src='http://farm4.static.flickr.com/3558/3510146588_d186db807e_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

images[51] = "<img src='http://farm4.static.flickr.com/3212/3509336235_ece8c65582_o.jpg' width=150 height=60 border=0 border=0 alt='Haloramics'></a>";

index = Math.floor(Math.random() * images.length);

document.write(images[index]);

//done

// --></script></center>
(create a new version of anything with text to see it properly in the iframe)
RoNo
RoNo
Active Poster

Male Posts : 1270
Reputation : 135
Language : English
Location : Laguna Beach, California

http://bf2mercenaries.forumotion.com/

Back to top Go down

dynamically resizing contents to fit a fixed sized iframe Empty Re: dynamically resizing contents to fit a fixed sized iframe

Post by DUM4S5 August 4th 2009, 2:30 am

i thought of doing this but i wanted to use the same source as it would be easier for me as i wouldn't need to add new images to both.

probably me being lazy but eh...

either way thanks for doing that for me i will use it =]
avatar
DUM4S5
New Member

Posts : 5
Reputation : 0
Language : English

http://www.haloramics.com

Back to top Go down

dynamically resizing contents to fit a fixed sized iframe Empty Re: dynamically resizing contents to fit a fixed sized iframe

Post by DUM4S5 August 4th 2009, 1:15 pm

if i wanted to do my original method still though, how would i go about doing it?

i spent ages on google trying to figure out a way, so im not sure its even possible.

would it be possible to implement some javascript/css which would resize content based upon the readers window size, as you can in flash.
avatar
DUM4S5
New Member

Posts : 5
Reputation : 0
Language : English

http://www.haloramics.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum