Resizeable iframe

This is a discussion on "Resizeable iframe" within the Web Page Design section. This forum, and the thread "Resizeable iframe are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Jun 5th, 2007, 13:34
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Resizeable iframe

I want my iframe to adjust it's height to the content, so the iframe itself dont have the scrollbar. I found a code for it, but I dont know where to put it.

http://blogs.x2line.com/al/articles/315.aspx Here is the code I intended to use.

http://home.online.no/~emfarsta/index.html
And my current site.
Thank you in advance

PS: My cousin helped me with the index file. I dont know too well how html works.


Lasse
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 5th, 2007, 18:11
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

Hei hei

Why are you tying to use an iFrame? Surely just regular pages would be better? You can use PHP includes to make updating easier, but iFrames are bad bad bad!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 5th, 2007, 18:15
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

Hm. Ok. Well, my cousin did it for me, so I dont know. I don't know if I'm going to change the set of the site now. Why is iframes so bad?
If someone know where to put the code, please let me know.

Lasse
BTW, first i thought you were Norwegian by the way you wrote "hei".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 5th, 2007, 18:25
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

iFrames are bad for SEO and accessibility. They help with loading time slightly, but anyone using broadband isn't going to care about 0.2 seconds.

I used to live in Hønefoss
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jun 5th, 2007, 18:30
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

Ah, I see. That's why you wrote "hei" so norwegianish. Well, I don't dare asking my cousin about coding a new framesite for me. As long as it works ok, I'll live with it. I just have to figure out how to make the iframe adjustable.
Here is the code, btw:

Quote:
<head>
<title>Supermenn.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--

body {
background-color:#3e3e3e;
background-image:url("http://home.online.no/~emfarsta/Pattern.jpg");
background-repeat:repeat;
padding:0;
margin:0;
}

#main {
background-color:#E5E5E5;
width:515px;
margin:0 auto;
padding:5px;
}

#banner {
background-color:#a0a0a0;
width:515px;
height:150px;
margin:0 0 5px;;
}

#meny {
background-color:#ffffff;
width:125px;
float:right;
margin-left:5px;
}

#tekst {
background-color:#ffffff;
border:0px none #ffffff;
width:385px;
height:500px;
float:left;
}
-->
</style>
</head>
<body topmargin="0" leftmargin="0">

<div id="main">


<div id="banner">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="515" height="150">
<param name="movie" value="toppbar.swf">
<param name="quality" value="high">
<embed src="toppbar.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="515" height=150"></embed>
</object>
</div>


<div id="meny">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="125" height="500">
<param name="movie" value="meny.swf">
<param name="quality" value="high">
<embed src="meny.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="125" height="500"></embed>
</object>

</div>
<iframe id="tekst" src="startside.htm" name="tekst" frameborder="0" scrolling="auto">
</iframe>
</div>


</body>
</html>
<script type="text/javascript" src="ieupdate.js"></script>
But thanks for the explanation. And I should have seen your nationality before, look at your avatar.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jun 5th, 2007, 18:42
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

I've never heard of an adjustable iFrame before. It'd probably take some nasty JavaScript work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jun 5th, 2007, 18:51
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

Well. I googled it, and it turned out to be several ways to do it. I have the code http://blogs.x2line.com/al/articles/315.aspx but I don't know how to use it with the code in my own html. I don't know if it works or how well, but I would like to try it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jun 5th, 2007, 20:13
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

For that link, it's an input button that increases the size of the iFrame. It's not automatic or precise. If you're a little bit familiar with JS, you might be able to work something out. I just know if JavaScript can pass variables from the iFrame page to the page the iFrame is on. I would guess that it's not possible.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jun 5th, 2007, 20:31
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

oh. Ok. I will see if I can sort something out.. Thanks for the help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jun 6th, 2007, 10:02
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

No problem. I would say that using regular pages would save you a lot of hassle, though!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jun 6th, 2007, 11:39
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 23
Posts: 1,668
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Re: Resizeable iframe

Find this code...
<iframe id="tekst" src="startside.htm" name="tekst" frameborder="0" scrolling="auto">
</iframe>

And change it to...
<iframe id="tekst" src="startside.htm" name="tekst" frameborder="0" scrolling="auto" height="500" width="600">
</iframe>

Play around with the numbers to make it fit

Ryan: I think what he's looking for is a one-off change to make it fit, not a dynamically changeable frame. Javascript is out of the question, too complicated and unecessary. It will only cause more problems...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jun 6th, 2007, 16:24
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

Hello spinal007.
If you see a bit up in the code you'll see that the height is already set. I can change it to fit the page, but as the content of the iframe changes from site to site it would not fit every page. I could make it height:10000px;, but that would look weird on the sites with little content. But thanks anyway.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Jun 6th, 2007, 17:22
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

If you want the iframe to grow with the content ... then why are you using an iframe at all?! Just add your use includes to include the content. I know you said your cousin did the site bla bla bla but you are really creating a big problem out of nothing.

Ditch the iframe and start using includes. You don't need to use PHP for includes, if your server support SSI (server-side includes) you can use that instead (it's javascript basically).

Using includes to add common elements to your sites.

Last edited by karinne; Jun 6th, 2007 at 18:02. Reason: Added article I just wrote ;)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Jun 6th, 2007, 17:45
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

ok, ok.. I will talk to him. I'm not creating a problem, I'm just trying to solve one. I don't know to code myself, and I don't know what includes are, but I will ask him if he knows.

Lasse
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Jun 6th, 2007, 17:59
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

Hm. he didn't wanna do new coding for me. I understand him well. He has done a lot for me lately. He says includes will make the whole site load again for every time you press the menu. I would really much like the toppbar and menu to be there all the time, without reloading..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Jun 6th, 2007, 18:08
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

Quote:
Originally Posted by Lassjus View Post
He says includes will make the whole site load again for every time you press the menu. I would really much like the toppbar and menu to be there all the time, without reloading..
Unless you're loading 3MB of coding you won't even know the difference!

Anyways ... I really hope you do find a way but like I said in my previous post, you're really going in the wrong direction with this.

Plus ... iframe suck for SEO and bookmarking purposes.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Jun 6th, 2007, 18:14
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

Hehe.. I doubt anyone will bookmark my site anyways Maybe I'm going in the wrong direction, but as long as I get it to work I'm quite happy. I'm not going to have a large code, but my flash header is playing music.. If i knew how to code I would use CSS or something fancy, but **** it, I don't have the time or patience to learn coding anyway
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Jun 6th, 2007, 18:25
Junior Member
Join Date: Sep 2006
Location: Oslo
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

I'll try includes. But not tonight.. To smooth, sunny, hot, nice, digg and deilig weather outside! Thanks for the replies!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19  
Old Jun 7th, 2007, 12:59
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resizeable iframe

I say use includes. They're super easy and if you don't understand them, just ask!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply