Page 1 of 1

finding page height

Posted: Thu Mar 17, 2005 10:39 pm
by shiznatix
ok sorry this may not be done in php but i cant find anywere else to ask how to do this. i have a page that detects your browser then based on that it excecutes a certain code that streches the iframe. well all works good with firefox but IE has major problems. what i need to do is find the height of the page in the iframe then set that height to the height of this one cell. so my question is how do i find the height of a iframe in pixels?

Posted: Thu Mar 17, 2005 10:52 pm
by feyd
attach an onload event handler to the iframe's code. You can read the height of the internals through it in various ways. You may need to inject an html container if it's not your page. At any rate, it's not PHP.


Moved to Client-side.

Posted: Thu Mar 17, 2005 10:54 pm
by shiznatix
ok well i thought it wasnt, and all the pages will be mine so i can do whatever i want. what am i looking at to do again sorry i have no idea what you said on whatever. any code as to get the height that you know of?

Posted: Thu Mar 17, 2005 11:08 pm
by feyd
why not just integrate these pages into the top level page? It's a lot less hassle.. :?

Posted: Thu Mar 17, 2005 11:12 pm
by shiznatix
like make each page seperate without the iframe? well i would but that seams like it would take me a while plus my customer wants the iframe cause he says that the seperate page thing is "yucky"

Posted: Thu Mar 17, 2005 11:12 pm
by infolock
this could definately be done, but it would have to be done through something like javascript. you coudl tell javascript that while an ondown mousebutton was in action, to echo out the height of the page to a variable whenever a mouseup action occurs after the mousedown.. best way i can think of to do it.

Posted: Thu Mar 17, 2005 11:14 pm
by shiznatix
sadly i know 0 javascript. i would like either some good links or possibly some code would make my life 1231325235246245 times easier? or am i asking too much

Posted: Thu Mar 17, 2005 11:22 pm
by infolock

Posted: Thu Mar 17, 2005 11:25 pm
by shiznatix
many thanks, i shall repost if i explode along the way :wink:

Posted: Thu Mar 17, 2005 11:40 pm
by infolock
glad to be of help. have fun 8)

Posted: Fri Mar 18, 2005 3:30 pm
by shiznatix
arg ok i did

Code: Select all

if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName==&quote;Netscape&quote;) {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf(&quote;Microsoft&quote;)!=-1) {
  winW = document.body.offsetWidth;
  winH = document.body.offsetHeight;
 }
}

document.write(
 &quote;Window width = &quote;+winW+&quote;<br>&quote;
+&quote;Window height = &quote;+winH
)
but sadly enough it dosnt work with IE. the whole porpus of this is to get cells to strech properly in IE but nothing that would work is compatable with it. Maybe there is a way i can just keep certain cells from changing their height while letting others change their height? or maybe there is some javascript that is compatable with IE?

Posted: Fri Mar 18, 2005 9:08 pm
by shiznatix
so nobody knows a compatable way for IE? i either need a way to keep certain cells from resizing or changing the height of this 1 cell to the height of the page inside of the iframe. the stuff i got before is not IE compatable.