finding page height

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

finding page height

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

why not just integrate these pages into the top level page? It's a lot less hassle.. :?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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"
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post 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.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

many thanks, i shall repost if i explode along the way :wink:
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

glad to be of help. have fun 8)
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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.
Post Reply