Results 1 to 3 of 3

Thread: Navigate to an iframe anchor on a different page

  1. #1
    Join Date
    Feb 2009
    Location
    Mill Valley, CA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Navigate to an iframe anchor on a different page

    Hi there -
    I need to be able to click a link on one page that will navigate to a certain anchor that is contained inside an iframe on the next page. I.E. user clicks "SERVICES" on index.html --> needs to nav to products.html#services which is the contents of an iframe on a page called index2.html. Not sure if this can be accomplished with javascript or not. Thanks for any help you can provide.

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    The simplest solution would be to just link to the anchor in the iframe like you would link to a normal page and then set the target to that iframe:
    HTML Code:
    <a href="/products.html#services" target="productsIframeName">Products</a>
    Good luck!

  3. #3
    Join Date
    Feb 2009
    Location
    Mill Valley, CA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your quick reply however...the iframe is contained on the next page. I.E. index1.html has the navigation, index2.html has the information which is contained in the iframe products.html and is controled by anchors. So the user clicks a link on index1.html that has no iframe, and is taken to index2.html, where the requested information is displayed at the top of the iframe products.html.

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
  •