Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-13-2010, 01:26 AM   PM User | #1
aeboarder3000
New to the CF scene

 
Join Date: Aug 2010
Location: Orlando, FL
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
aeboarder3000 is an unknown quantity at this point
Detect <DIV> size and insert into another page?

I have a goal in mind, and that is to get the width & height of a <DIV> tag in one document and insert them into another document...all on the same domain. It sounds like a simple task, but in case more detail is needed, let me explain:

I have a page called 'demo.html' which launches a page called 'gallery/archive_iframe.html' via Shadowbox as an iFrame. The problem is that 'gallery/archive_iframe.html' slightly differs in dimension on every browser and screen resolution. I want to have the iFrame's size detected every time it launches so Shadowbox can get solid dimensions to display it without scrollbars.

You can see the current (fixed size) example at:
http://www.mikegermond.com/demo.html
Click on the 'Video Archive' image.

Here is the code I would like to insert the dimensions in to:
Code:
<A HREF="/gallery/archive_iframe.html" rel="shadowbox;width=???;height=???" class="imgLink" title="Video Archive"><img src="gallery/videoarchive_thm.jpg" alt="Launch Video Archive (popup window)" width="260" height="162" border="0" /></A>
aeboarder3000 is offline   Reply With Quote
Old 08-13-2010, 08:25 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by aeboarder3000 View Post
I have a goal in mind, and that is to get the width & height of a <DIV> tag in one document and insert them into another document...all on the same domain. [/CODE]
Not possible, AFAIK, to get the variable height and width of a <div>. And in any case there are browser incompatibility problems.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

Last edited by Philip M; 08-13-2010 at 08:28 AM..
Philip M is offline   Reply With Quote
Old 08-14-2010, 01:38 AM   PM User | #3
aeboarder3000
New to the CF scene

 
Join Date: Aug 2010
Location: Orlando, FL
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
aeboarder3000 is an unknown quantity at this point
Any ideas as to other ways to get the width & height of the content area of a page?
aeboarder3000 is offline   Reply With Quote
Reply

Bookmarks

Tags
div, iframe, insert, shadowbox, size

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:06 PM.


Advertisement
Log in to turn off these ads.