473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

how to find out the size(height and width) of frame in iframe

hello,

I want to find out the height and width of right frame in iframe that is included in left frame.

main.html
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <frameset cols="15%, *" id="fs1">
  3. <frame src="left.html" name="left" frameborder="1" id=leftId >
  4. <frame src="right.html" name="right" frameborder="1" id=rightId>
  5. </frameset>
  6. </html>
suppose in left frame i have included a iframe and in that iframe code i want to find out the size of right frame.

left.html
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <iframe src ="iframe_test.html" width="100%" height="300px">
  6. </iframe>
  7. </body>
  8. </html>
right.html page could be any html page.

iframe_test.html
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script>
  4. // Here i want to find out the height and width of right frame 
  5. </script>
  6. </head>
  7. </html>
Jan 5 '09 #1
1 3089
Nicodemas
164 Expert 100+
try this:

Expand|Select|Wrap|Line Numbers
  1. var frameR = window.frames[1].contentDocument;
  2.  
  3. var frameR_w = frameR.width ? frameR.width : frameR.documentElement.offsetWidth;
  4.  
  5. var frameR_h = frameR.height ? frameR.height : frameR.documentElement.offsetHeight;
  6.  
Jan 5 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Arthur Connor | last post by:
I want to embed some source code lines in an article on a web page. As usual I want to use a fixed sized font for this souce code lines (read: the letters should have all the same width). The...
1
by: Øyvind Isaksen | last post by:
Hello! How can I use ASP to check the size of the images used in my solution? This is what I need to do: If the width of an image is more than 256px, I want to set the image width to 256px....
8
by: brett | last post by:
How can I find the height and width of a webpage? Say I want to make sure someone's webpage is within an 800X600 viewing area. Width is the most important but if I can get width, I should also be...
1
by: Drew | last post by:
Hey, thanks in advance for helping me out with my problem: I have a datagrid which is embedded in another datagrid. The datagrid is filled directly by a dataset generated from a sql query. So...
5
by: Pohihihi | last post by:
Why can't the following work when it has a set property defined? this.textBox1.Size.Width = 25; I get error Cannot modify the return value of 'System.Windows.Forms.Control.Size' because it is...
8
by: Jack | last post by:
Hi, I have a asp page where multiple rows for a client is generated using asp. Some of these are combo boxes and some are text and are coming from a recordset. Now, the following is the code to...
0
by: ABC | last post by:
How to make change one frame size (width) when I clicked a button on anothoer frame?
3
by: Adam Smith | last post by:
Hello, How does one adjust the input field size (height) in a form, say to accept 10pt rather than the 12pt txt that apparently is the norm. Thanks --Adam--
1
by: vbMark | last post by:
Hello, I am putting text into a TextBox from a database. The text is different lengths. I would like to size the TextBoxes automatically to the hight necessary to see all of the text. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.