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.
|
|
|
|
|
![]() |
||
Resizeable iframe
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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 |
|
|
|
#2
|
||||
|
||||
|
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! |
|
#3
|
|||
|
|||
|
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". |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
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:
|
|
#6
|
||||
|
||||
|
Re: Resizeable iframe
I've never heard of an adjustable iFrame before. It'd probably take some nasty JavaScript work.
|
|
#7
|
|||
|
|||
|
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.
|
|
#8
|
||||
|
||||
|
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.
|
|
#9
|
|||
|
|||
|
Re: Resizeable iframe
oh. Ok. I will see if I can sort something out.. Thanks for the help.
|
|
#10
|
||||
|
||||
|
Re: Resizeable iframe
No problem. I would say that using regular pages would save you a lot of hassle, though!
|
|
#11
|
||||
|
||||
|
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)
|
|
#12
|
|||
|
|||
|
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. |
|
#13
|
|||
|
|||
|
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 ;) |
|
#14
|
|||
|
|||
|
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 |
|
#15
|
|||
|
|||
|
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..
|
|
#16
|
|||
|
|||
|
Re: Resizeable iframe
Quote:
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. |
|
#17
|
|||
|
|||
|
Re: Resizeable iframe
Hehe.. I doubt anyone will bookmark my site anyways
|
|
#18
|
|||
|
|||
|
Re: Resizeable iframe
I'll try includes. But not tonight.. To smooth, sunny, hot, nice, digg and deilig weather outside!
|
|
#19
|
||||
|
||||
|
Re: Resizeable iframe
I say use includes. They're super easy and if you don't understand them, just ask!
|
![]() |