Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Location
    Orlando, FL
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,249
    Thanks
    203
    Thanked 2,557 Times in 2,535 Posts
    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 09:28 AM.

  • #3
    New to the CF scene
    Join Date
    Aug 2010
    Location
    Orlando, FL
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any ideas as to other ways to get the width & height of the content area of a page?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •