33 users online (0 members and 33 guests)  


  Results 1 to 3 of 3

Related

  1. Replies: 1
  2. Passing value from iframe to parent    Forum: Javascript Forum
    Replies: 0
  3. Frame-Parent function calls?    Forum: Javascript Forum
    Replies: 2
  4. Replies: 0
  5. Link to top of parent document    Forum: HTML Forum
    Replies: 0
  1. #1
    Velo's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2004
    Posts
    7

    Link to top of parent document

    Ok then, here's another problem I'm encountering.

    I want to create a "back to top" link on all of my pages within my iframe (all of the child pages). I want this link to point back to the top of the parent page (the page containing the iframe), but keep the iframe on it's current page. That is, link to the top of the parent page without changing anything within the iframe.

    I've been fiddling with parent.location.hash and such but can't seem to figure it out.

    my webpage is here www.cstrikerun.com

    Thanks for help: (i'm making good use of this forum) lol

  2. #2
    Velo's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2004
    Posts
    7
    ok since no one knew what I was talking about, or no one knew how to do it lol I will post how I kind of worked around the situation.

    In my parent page I put a name attribute on an image I had at the top of my page like so :
    Code:
    <img name="top" id="logo" src="/images/Logohat.jpg" width="980" alt="Cstrike Run">
    Then in my Iframes I linked to the top of my parent page by doing this:
    Code:
    <a href="/introduction.html" onClick="parent.location.hash='top';">Back to top</a>
    Since I named the image "top", I did an onclick ...hash="top". That pretty much works.

    I'm not happy with the fact that I have to reference the same page the link is on in order for that event to occur.....but I guess it's ok since it works pretty well.

  3. #3
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Glad you got it working ok

    Dave



Tags for this Thread