dynamically resizing contents to fit a fixed sized iframe
2 posters
Page 1 of 1
dynamically resizing contents to fit a fixed sized iframe
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.
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.
Re: dynamically resizing contents to fit a fixed sized iframe
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)
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>
Re: dynamically resizing contents to fit a fixed sized iframe
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 =]
probably me being lazy but eh...
either way thanks for doing that for me i will use it =]
Re: dynamically resizing contents to fit a fixed sized iframe
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.
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.
Similar topics
» what king of contents count in illegal contents
» what king of contents count in illegal contents
» change the <iframe></iframe> with BBCode
» How to keep images sized?
» over sized image need scroll bar
» what king of contents count in illegal contents
» change the <iframe></iframe> with BBCode
» How to keep images sized?
» over sized image need scroll bar
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum