Jump to content


How to make iFrame's height be the same as the page it will load?


13 replies to this topic

#1 Matheus

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,058 posts
  • Gender:Not Telling

Posted 05 May 2006 - 07:29 PM

Here is the problem:
- I don't want my iFrame with a scrollbar, I want it to resize it's height acording to the height of the page it wil load

exemple: I click on a hyperlink to a page with 900px height (target on the iFrame). But the iFrame is currenlty with 300px. How can I make it automaticaly resize to 900px when clicking the hyperlink?

thank you

#2 Indigo

    Official Alien

  • Members
  • PipPipPip
  • 617 posts
  • Gender:Male
  • Location:Trondheim, Norway
  • Interests:Computing in general, especially design and programming of all kinds.

Posted 06 May 2006 - 03:20 AM

Oh my, it's a long time since I worked with iframes! :P
What you could do is something like this, but I'm not sure:
<iframe scrolling="no" height="100%"></iframe>

Hope it helps!

#3 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 06 May 2006 - 09:31 AM

That wont work, the iframe will stretch not as much as the frames page is but as high as the table column its in, if you know what i mean.
Your better of using a php include
<?php include("file.html"); ?>

#4 Indigo

    Official Alien

  • Members
  • PipPipPip
  • 617 posts
  • Gender:Male
  • Location:Trondheim, Norway
  • Interests:Computing in general, especially design and programming of all kinds.

Posted 06 May 2006 - 12:51 PM

Includes are way better, yeah - IF your host supports php. I was on a non-php-supportive host for over a year myself, and found iframes useful for most of my tasks.
But if my example won't do, I have no clue.

#5 Matheus

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,058 posts
  • Gender:Not Telling

Posted 06 May 2006 - 02:38 PM

View PostAvalanche, on May 6 2006, 02:31 PM, said:

That wont work, the iframe will stretch not as much as the frames page is but as high as the table column its in, if you know what i mean.
Your better of using a php include
<?php include("file.html"); ?>

i put that code instead of
<iframe 
src ="/anypage.htm">
</iframe>
?

hwo do I use it correclty? (any tutos?)

#6 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 06 May 2006 - 03:14 PM

http://scudworkz.com...rials/includes/ :)

#7 Matheus

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,058 posts
  • Gender:Not Telling

Posted 06 May 2006 - 05:22 PM

ok, i followed the tuto, but it doesn't load anything. isn't hosted yet, but I can't see nothing when I open it with firefox

#8 syndrome

    P2L patient #4819

  • Twodded Staff
  • PipPipPipPip
  • 1,311 posts
  • Location:Nottingham, UK
  • Interests:Photoshop, Tennis, PS2, web design, CS:S

Posted 06 May 2006 - 05:32 PM

http://www.pixel2life.com/forums/index.php...t=0&#entry49396

#9 Matheus

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,058 posts
  • Gender:Not Telling

Posted 06 May 2006 - 07:21 PM

I tryed the iframe resize stuff with the javascript, it worked but not so good, there were some bugs (javascript isn't too good)
I wan't to know more about this include funcion, searched pixel2life for include at PHP section but I didn't get a nice explanation

#10 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 06 May 2006 - 08:18 PM

php doesn't work on regular computers, you need to upload it first

(unless you installed php onto your pc (i dont think you did..))

#11 Matheus

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,058 posts
  • Gender:Not Telling

Posted 06 May 2006 - 10:58 PM

and how do I make links target to the include?

#12 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 07 May 2006 - 12:55 AM

you cant.

you need to use a different include for each page, then have links target the page.

#13 Matheus

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,058 posts
  • Gender:Not Telling

Posted 07 May 2006 - 04:31 PM

View Postcoolaid, on May 7 2006, 05:54 AM, said:

you cant.

you need to use a different include for each page, then have links target the page.

hmm
I still don't get it
any complete tuto page about this?

Edited by Myoto, 07 May 2006 - 04:32 PM.


#14 rc69

    PHP Master PD

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

Posted 08 May 2006 - 03:20 PM

http://www.pixel2life.com/forums/index.php...20995&hl=iframe

This question has been asked before, please use the forum search.

Edited by rc69, 08 May 2006 - 03:21 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users