/    Sign up×
Community /Pin to ProfileBookmark

How to dertermine the height and width of web page

Hey all! I need to determine the height and width of a web page for an iframe. Can you help? [url]http://showtime.0moola.com/announcement.html[/url]

thanks in advance!
Christy

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@mrhooFeb 16.2006 — If you call the following code with no arguments, it will return the integer part of the pixel width and height of the browser window in a two element array.

If you pass it an element reference it will return the [width,height] of that element.

Of course you have a default size for when the script is turned off or feeble.

[CODE]
function elSize(hoo){
hoo= (hoo && hoo.nodeType===1)? hoo: false;
var A;
if(hoo){
var bh= [hoo.scrollHeight,hoo.offsetHeight];
var bw= [hoo.scrollWidth,hoo.offsetWidth];
A= (bh[0]>bh[1])? [bw[0],bh[0]]: [bw[1],bh[1]];
}
else{
if(self.innerHeight) A= [self.innerWidth,self.innerHeight];
else{
var D= document.documentElement;
if(D && 'clientHeight' in D) A= [D.clientWidth,D.clientHeight];
else A= [screen.width,screen.height];
}
}
return A;
}
[/CODE]
×

Success!

Help @cantes903 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...