TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,972
  • Latest: Lineo
Stats
  • Total Posts: 196,165
  • Total Topics: 21,346
  • Online today: 678
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 191
  • Total: 191

Iframe Automatic resizing

Started by Rocket, November 12, 2005, 01:06:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aptd

I hate to bring up old topics...but I just can't get this to work!

I could really use some help, my brain is fried. :uglystupid2:

Anyway..

I have set up my article



I have set up my Menu Item



and nothing.  Thing isn't showing up.  Though as you can see.  It shows up in the WYSIWYG article editor.




Any help would be GREATLY appreciated!

_D

IchBin


aptd


stigmartyr

What is the <iframe> code you are using.. the whole string.. can you paste it?

It looks like you have some kind of script embedded in a page that is not the same size as the frame is told to be.

aptd

I started with this when I made the article...

<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript">

/***********************************************
* IFrame SSI script II- ÂÃ,© Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script>
</head>

<body>
<iframe id="myframe" src="csserverpage.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:novisible; width:100%; display:none"></iframe>
</body>
</html>


And when I go back to the article..and click on the <> HTML button on the right there..it shows in green.

<IFRAME id=myframe style="DISPLAY: none; WIDTH: 100%" marginWidth=0 marginHeight=0 src="csserverpage.html" frameBorder=0 scrolling=no></IFRAME>

stigmartyr

I see ur using some sorta of auto generated iframe thingy.. IDK what its intended to produce... looks very bloated.


I suggest you try this modified iframe to open the csserverpage.html page, instead:


<iframe name="mainFrame" id="mainFrame" src="csserverpage.html" scrolling="no" align="center" frameborder="0" width="enter number in pixels here" height="enter number in pixels here"></iframe>



You will want to play with the height and width until it fits what you want it to look like.  Just start with 300 on each and go from there. ;)

The ginormous code you pasted for only opening a single iframe seems lag-tastic.

Let me know if it helps you!

aptd

I guess the "bloated" code, was that it would be dynamic to the stuff being loaded, instead of having to set the dimensions manually.  But I will try your way in a second here.

stigmartyr

ohhh.. so ur saying that it would auto-resize when the person views your content?  If the content window is going to expand and shrink you will want to provide static space for it anyways, IMHO.


In designing web-sites I try to keep the page from jumping around too much.  It irritates people.  You could start out with a fixed size canvas (black background or other) and set it to accomodate the largest sized page that will be opened inside. 

If you set scrolling to: scrolling="yes" or "auto" you can get scroll bars as well to scroll through stuff.

aptd

Ok, I guess the thing im trying to put in might not work like this.  But I cant figure out how to do it.

Suppose maybe teh HTML file needs to be changed.

What I am trying to put this stuff in this center there when I click on "Servers" under the content menu.  
http://dsull.com/smf/csserverpage.html

but you see, using the script, you gave me, I even put a height of 800 and a width of 400 and still end up with just part of the stuff.

As you can see here:

http://dsull.com/smf/index.php

I'mma do a search real quick to see how somebody else put it in.  I know I found some stuff where they put the information into blocks and put them on the left or right.  But i just want it as a seperate section under "servers".

_D

stigmartyr

The reason only PART of the csserverpage.html is showing is because the html page itself must be edited as well.

It is probably set to ALIGN="left" or "right" or something...


Make sure that it is aligned to CENTER and at the VERY top of the page.  It should then do its own job of auto-aligning itself in the iframe.

This website is proudly hosted on Crocweb Cloud Website Hosting.