SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Nov 2002
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    load frame then hide/show div.

    I now have a situation where I load a frame with a new .txt file and what to show/hide divsions upon opening. My problem has been getting the timing of the execution right. In other words, I want the frame to load first, then the hide/show script to execute.

    How would I go about doing this?

    -berzerko

  2. #2
    SitePoint Addict
    Join Date
    Jul 2000
    Posts
    201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about adding a onload to your frameset tag:

    <frameset cols="50%,*" onLoad="yourHideShowScript();">

  3. #3
    SitePoint Addict
    Join Date
    Nov 2002
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by FauxPas
    How about adding a onload to your frameset tag:

    <frameset cols="50%,*" onLoad="yourHideShowScript();">
    Doesn't work. I am using an Iframe, does that matter?
    heres my html
    Code:
    <iframe SRC="0.html#Pg1" onLoad="showPage();" name="there" id="there" width="100%" height="100%" Frameborder="0" marginheight="0" marginwidth="0" scrolling="yes"  />
    Does anything stand out to you?

    Also, once in the frame, I am reloading .txt files as such
    Code:
    frames['there'].location.href=elem.chapt.value+'.html#Pg'+elem.page.value;
    My hide/show script does not work on the first div, when the new page is loadedfor example if I have this
    Code:
    frames['there'].location.href=elem.chapt.value+'.html#Pg'+elem.page.value;
    		hideObj(elem.olpgid);
    		showObj(elem.newpgid);
    It seems to run the script before the page has a chance to load. In otherwords, it works on the last .txt file before the new one loads.

    -b

  4. #4
    SitePoint Addict
    Join Date
    Nov 2002
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I was wrong in my implementation, it works now in Mozilla, BUT NOT IE or SAFARI...uuugghhh!

    here is the code that worked:
    Code:
    <iframe SRC="0.html#Pg1" onLoad="showObj('Pg'+document.forms['chapage'].elements['pge'].value);alert('Pg'+document.forms['chapage'].elements['pge'].value)" name="there" id="there" width="100%" height="100%" Frameborder="0" marginheight="0" marginwidth="0" scrolling="yes" >
    		</iframe>
    The alert doesnt even show up in IE5 mac. Does anything stand out to anybody? Is ther a way to make this work with IE5 mac?

    -b
    Last edited by berzerko; Mar 25, 2004 at 23:18.

  5. #5
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What are you loading into the iFrame - a pure text file? You probably need to wrap the text in something like...
    Code:
    <html>
    <head>
    window.onload = function()
    {
      // now call back to parent frame to signal load event
    }
    </head>
    <body>
    ... insert text here ...
    </body>
    </html>
    just a quick idea


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
  •