Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2005
    Location
    New Zealand
    Posts
    76
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Internet Explorer Iframe moved up hiding JScript Menu when I click on internal hyperlink to anchor

    Hi,

    I am developing a JScript menu for the intranet here at work, it works fine but I have encountered an issue to to with the iframe the content is displayed in when page the iframe is displaying has hyperlinks to anchors further down in the document (its an FAQ page).

    What happens is that that when I click on one of the links at the top of the page and it is scrolled down to that place in the document where that topic starts, Internet Explorer is moving the entire iframe up meaning that the content on the parent page above the iframe (which is where the jscript menu sits) is no longer visible, and a space of about an inch / 2.5 cm appears along the bottom of the screen.

    I have the overflow set to hidden in the body tag of the parent web page that contains the menu and the iframe so that the menu cannot normally be scrolled off the screen by the user (an this works fine), but that is not stopping IE doing this when a user clicks on the one of the FAQ links.

    Anyone out there had a similar problem? or have any suggestions on how to fix this?

    Thanks,

    Doug.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Yep, come across the very same problem myself and the only solution I could come up with at the time was to run a function to correct it.

    This does mean having to call the function from each link in the iframe.

    The function can be put in the parent page then called from the document in the iframe with

    onclick="parent.reset_pos()

    function reset_pos(){
    n=document.body.scrollTop
    setTimeout("document.body.scrollTop=n",5)
    }

    I also found that a slight delay works best.

    Someone else may have a better solution though.
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New Coder
    Join Date
    May 2005
    Location
    New Zealand
    Posts
    76
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Thanks, it works perfectly.

    Cheers!

    Doug.


  •  

    Posting Permissions

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