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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Iframes in HTML windows

    Hello everyone. Here is the goal I wish to achieve

    I want to place a blog webpage (PHP) inside an iframe object. I would like to be able to dynamically adjust the height of the entire iframe object upon each click of the mouse button (mouse event) when cursor is inside the iframe area.

    Any help would be great

    thanks

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Are both the blog and the page with the iframe on the same domain or are they different domains?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    If the click event bubbles up from the inner document (blog) to the iframe itself (not sure if it does; probably different from browser to browser) then it won't matter about the domains.

    But you didn't mention how much bigger/smaller it should get...

    Code:
    var frame=document.getElementById("yourIframe");
    
    frame.addEventListener("click", changeHeight, false);
    
    function changeHeight() {
        this.style.height=n+"px";
    }

  • #4
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My apologies about the very brief description.

    Its a HTML page with an iframe object showing the blog page (PHP).

    The Blog page and the HTML parent page are in the same directory therefore the same domain.

    With regard to the iframe height on each mouse event I would like the browser to calculate the scroll height (not the display) of the blog page and adjust the iframe height accordingly so the iframe can display the blog in its full height capacity without the need for a scroll bar.

    thanks

  • #5
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ^bump^

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by greenelephant View Post
    ^bump^
    FYI it was New Year's Eve in the US when you bumped. Be patient. If you aren't patient don't expect much help.

    http://www.dynamicdrive.com/dynamici...iframessi2.htm
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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