Results 1 to 2 of 2

Thread: code to snap to the top of the page (iframes)

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

    Default code to snap to the top of the page (iframes)

    I am using 2 iframes on a page. One is static and contains a flash menu, the other loads in different html pages. My problem is when I have a long page loaded into it with a link at the bottom. This link loads in a shorter page so it shows up as a blank space until u scroll back up to the top of the page. I want a way to make the page snap up to the top. I have tried using "target_top" but this overwrites the iframe at the top.

    Thanks for any help received.
    lainer

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Don't use target for that. The only HTML solution for this is to add an anchor name to the page (the one you will be loading into the iframe) at its top, just after its opening <body> tag:

    Code:
    <a name="top"></a>
    Then when linking to that page, use this type href in your anchor link:

    Code:
    <a href="whatever.html#top">Whatever</a>
    If the situation is such that this cannot be done or doesn't solve the specific problem you are talking about, a redesign of the page to get your content into the actual position where you want it to be may be in order or you may wish to resort to javascript.

    To be of much more help, I would need to have a link to the problem page(s).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •