Jump to content


How would you code a stretchable iframe?


5 replies to this topic

#1 UnderAttak

    Young Padawan

  • Members
  • Pip
  • 57 posts
  • Gender:Male
  • Location:San Diego

Posted 17 March 2007 - 03:40 AM

My client needs an iframe on his page to load samples of his PHP scripts. He also wants it stretchable to any size if the window is not maximized. I haven't worked with iframes in years and would have no idea how to code them to stretch.

#2 _*Creative Insanity_*

  • Guests

Posted 17 March 2007 - 03:44 AM

I am not sure you can. They are normally a fixed pixel size.

#3 N4Z.

    Call me Yoda

  • Members
  • PipPipPipPip
  • 3,016 posts
  • Gender:Male
  • Location:127.0.0.1
  • Interests:Designing, Apple Fan Boy, Music Production and Weekends!

Posted 17 March 2007 - 04:08 AM

iFrames are terrible imo, php page includes are always better :D

stretchable too :P

#4 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 17 March 2007 - 12:15 PM

Iframes cannot be stretched by the user, but this question has been asked here before if you do a little searching, i believe faken was one of the people who finally solved the problem.

#5 UnderAttak

    Young Padawan

  • Members
  • Pip
  • 57 posts
  • Gender:Male
  • Location:San Diego

Posted 18 March 2007 - 12:45 AM

Yeah I've been trying to convince them to not go with iframes. Apparently they sent me this site with a stretchable iframe. I haven't examined the code yet though.

http://www.mydump.in...me_stretch.html

Edit: looks like to me you can just use some CSS to code the iframe's width to 100% or whatever percentage you need.

Edited by UnderAttak, 18 March 2007 - 12:48 AM.


#6 _*Creative Insanity_*

  • Guests

Posted 18 March 2007 - 02:03 AM

Interesting.. but I still hate iframes.
#module {
	border: 2px solid #8A8A8A;
	width: 95%;
	margin: 0px auto;
}

#module iframe {
	display: block;
	width: 100%;
	height: 500px;
	
}
<div id="module"><iframe id="frame_module" name="frame_module" FRAMEBORDER=0 src="./modules/home.php"></iframe></div>

Edited by Creative Insanity, 18 March 2007 - 02:05 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users