Results 1 to 5 of 5

Thread: iframe trouble

  1. #1
    Join Date
    May 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default iframe trouble

    Hi there,
    Ill get straight to the problem!
    I have a css menu with javascript on the buttons. These are supposed to load my swf files into my iframe... which works fine if you dont press the same button twice. Thats basically my problem. I dont know why its doing that.
    Is there a workaround?
    I would really appreciate any help with this.
    Thanks

    PS!
    Im not a programmer!

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Is there a workaround?
    Probably.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    More info? Link? something?

  4. #4
    Join Date
    May 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello again,
    Thanks for the quick reply... I havent updated my site yet but the javascript on the button is:

    <li><a class="" href="./test.swf" onclick="return loadIframe('ifrm', this.href)"></a></li>

    The iframe script:
    <div class="iframe">
    <iframe style="height: 460px;" name="ifrm" id="ifrm" src="./content.htm" frameborder="0" height="100%" scrolling="Auto" width="100%">Sorry, your browser doesn't support iframes.</iframe>
    </div>


    // JavaScript Document

    /*************************************************************************
    This code is from Dynamic Web Coding at http://www.dyn-web.com/
    See Terms of Use at http://www.dyn-web.com/bus/terms.html
    regarding conditions under which you may use this code.
    This notice must be retained in the code as is!
    *************************************************************************/

    function getDocHeight(doc) {
    var docHt = 0, sh, oh;
    if (doc.height) docHt = doc.height;
    else if (doc.body) {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
    }
    return docHt;
    }

    function setIframeHeight(iframeName) {
    var iframeWin = window.frames[iframeName];
    var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
    if ( iframeEl && iframeWin ) {
    iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
    var docHt = getDocHeight(iframeWin.document);
    // need to add to height to be sure it will all show
    if (docHt) iframeEl.style.height = docHt + 30 + "px";
    }
    }

    function loadIframe(iframeName, url) {
    if ( window.frames[iframeName] ) {
    window.frames[iframeName].location = url;
    return false;
    }
    else return true;
    }
    Last edited by scoobidoo; 05-03-2006 at 06:52 PM.

  5. #5
    Join Date
    May 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem fixed...

    Hi there,
    The problem is fixed now so if anyone has decided to help me out please dont worry... Mainly me that worries!
    I can post the code later if anyone wants to see it. Pretty standard though & Im sure most of you guys already know it.

    Thanks any way...

Bookmarks

Posting Permissions

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