Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML HTML Basics

Iframe contents

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

Iframe contents

Postby drimades » Mon Mar 15, 2004 10:14 am

----------------------------------------------------------

Hello!

I have an iframe with different contents each time. How can it fit the contents each time (flow) without a scroll bar?
Thank you,

----------------------------------------------------------
drimades
New php-forum User
New php-forum User
 
Posts: 39
Joined: Wed Oct 29, 2003 2:11 pm

Postby gesf » Mon Mar 15, 2004 11:54 pm

Don´t you want a scrollbar? Is that right !?
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Re: Iframe contents

Postby WiZARD » Tue Mar 16, 2004 2:24 am

drimades wrote:----------------------------------------------------------

Hello!

I have an iframe with different contents each time. How can it fit the contents each time (flow) without a scroll bar?
Thank you,

----------------------------------------------------------

in IFRAME tag add scroll="auto" or scroll="on"
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Postby drimades » Wed Mar 17, 2004 10:22 am

-------------------------------------------------------------


It doesn't work! The scrollbar appears the same.

I need an iframe looking like a table!

Thank you

-------------------------------------------------------------
drimades
New php-forum User
New php-forum User
 
Posts: 39
Joined: Wed Oct 29, 2003 2:11 pm

Postby swirlee » Wed Mar 17, 2004 11:21 am

Why not just use a table?
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby drimades » Fri Mar 19, 2004 2:46 am

------------------------------------------

Because the src property is variable!

------------------------------------------
drimades
New php-forum User
New php-forum User
 
Posts: 39
Joined: Wed Oct 29, 2003 2:11 pm

Postby gesf » Fri Mar 19, 2004 4:00 am

This is what you can have on a iFrame:
Code: Select all
<IFRAME
ALIGN=ABSBOTTOM | ABSMIDDLE | BASELINE | BOTTOM | LEFT | MIDDLE | RIGHT | TEXTTOP | TOP
BORDER=integer
BORDERCOLOR=color
DATAFLD=colname
DATASRC=#ID
FRAMEBORDER=string
FRAMESPACING=string
HEIGHT=string
HSPACE=variant
CLASS=string
ID=string
LANG=string
LANGUAGE=JAVASCRIPT | JSCRIPT | VBS | VBSCRIPT
MARGINHEIGHT=string
MARGINWIDTH=string
NAME=window_name
NORESIZE=NORESIZE | RESIZE
SCROLLING=AUTO | NO | YES
SRC=string
STYLE=string
TITLE=string
VSPACE=string
WIDTH=string
event = script
></IFRAME>
So, try:
Code: Select all
This:
scrolling="no"

And this:
noresize="resize"
In order to bring your code up to HTML 4.01 standard, write the tag names in lowercase!
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby drimades » Mon Mar 22, 2004 2:00 am

----------------------------------------

<IFRAME id="boh" src="display-prop.php?action=Initial" width="90%" allowtransparency="true" scrolling="no" noresize="resize" align="center">
</IFRAME>


Still it doesn't work!

:(

----------------------------------------
drimades
New php-forum User
New php-forum User
 
Posts: 39
Joined: Wed Oct 29, 2003 2:11 pm

Postby gesf » Mon Mar 22, 2004 4:16 am

Try this one:
Code: Select all
<iframe id="boh" src="display-prop.php?action=Initial" width="90%" allowtransparency scrolling="no" resize align="center"></iframe>
Don´t forget, you better write your code in lowercase!
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby drimades » Mon Mar 22, 2004 6:16 am

-------------------------------------------

Nothing! The dimension of the iframe remains the same

-------------------------------------------
drimades
New php-forum User
New php-forum User
 
Posts: 39
Joined: Wed Oct 29, 2003 2:11 pm

Postby gesf » Mon Mar 22, 2004 6:57 am

well i´m almost sure we can´t change an iframe size that way.
I think the resize/noresize properties are to specify whether we can change its size or not!
Let´s try it with javascript. Place this code between <head></head>!
Example (replace 'iframe_name' with your iframe name):
Code: Select all
<script language="JavaScript">
function resize() {
var iframe = document.all.iframe_name;
iframe.height=document.frames("iframe_name").document.body.scrollHeight;
}
</script>
Use the onload property in your body or even in your iframe tag.
Example:
Code: Select all
<body onload="resize()">
or...
<iframe onload="resize()">

Than add this property to your iframe, Like:
Code: Select all
<iframe scrolling="no" ></iframe>
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby drimades » Mon Mar 22, 2004 2:11 pm

-------------------------------------------------

Finally!

Thanks

-------------------------------------------------
drimades
New php-forum User
New php-forum User
 
Posts: 39
Joined: Wed Oct 29, 2003 2:11 pm

Postby drimades » Thu Apr 01, 2004 12:01 am

------------------------------------

Hello!

There is a problem: if I write onload() there is a delay of 2-3 seconds until the frame resizes. Maybe it waits for the page to load and then resize ...

Do you have any idea about?

------------------------------------
drimades
New php-forum User
New php-forum User
 
Posts: 39
Joined: Wed Oct 29, 2003 2:11 pm

Postby gesf » Thu Apr 01, 2004 12:42 am

What do you have ?
This:
Code: Select all
<body onload="resize()">
or this ...
Code: Select all
<iframe onload="resize()">
??
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby drimades » Thu Apr 01, 2004 2:59 am

-------------------------------------

The second one!

-------------------------------------
drimades
New php-forum User
New php-forum User
 
Posts: 39
Joined: Wed Oct 29, 2003 2:11 pm

Postby gesf » Thu Apr 01, 2004 3:35 am

And that one seems to be faster than the first!
Hunn... i don´t see how you can you put it faster than that!
Try to call that function when you link to the iframe.
Example:
Code: Select all
<a href="somefile.htm" target="iframe_name" onClick="resize();">link</a>
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden


Return to HTML Basics

Who is online

Users browsing this forum: TurnitinBot [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.