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 to the CF scene
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question new page loads at bottom???

    Newbie - please be gentle.

    Hope someone can help. I've spent a couple of days trying to have a go at this myself but cannot figure it out. I'm a complete javascript novice.

    I have a content page that opens in an iFrame and the content is then scrollable so that you can see the stuff at the bottom of the page. When you click on a picture link at the bottom of this page it opens a new content page in the iFrame with larger pics etc but it opens it at the bottom of the new page (where the previous page scroll was).

    I have tried using the <a href="url.htm#top" anchor link to go to an anchor point on the new page with <a name="top"></a> on the new page...that didn't work.

    I have tried numerous onLoad functions to anchor points and numerous pagescroll() functions but cannot get it to work.

    The site in question is in working progress at http://www.mostwantedclothing.co.uk/
    click on the 'one more round' link in the nav on the left and then scroll down to the very last row and click on the middle pic (only this one active for testing purposes) and you'll see the new page with big pics open at the bottom instead of the top.

    Thanks in advance.

  • #2
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    u cud try make a piece of javascript that clicks the link

    u would need to change ur link to have an ID

    Code:
    <script>
    
    function tothetop()
    {
    
       document.getElementById("top_link").click();
    
    }
    
    window.onload = tothetop;
    
    </script>
    <a href="#top"> //currently
    <a href="#top" name="top_link">
    shud do it, but i havn't tested so let me know if it works.

  • #3
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Thanks for your reply.

    Does all of the code go between the 'head' and not sure what you mean by 'change ur link to have an ID'

    Told you I was a newbie


  •  

    Posting Permissions

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