Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Top Of Page Link

  1. #1
    Join Date
    Nov 2007
    Location
    Maine USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Top Of Page Link

    I have used the following code to provide a link at the bottom of my page back to the top that works in IE and FF. The dilema is however this location is below my nav and header and therefore not really the top of the page at all , it's the pages title. Is there another way of doing this so that it goes right to the very top of the page including the header image as well. The code I used is:

    <div class="header9"><a name="top">Heavenlee Acres Camping Rates</a></div>


    The actual link is;

    <div class="navbar3">
    <ul>
    <li><a href="#top"> Top of page</a></li></ul></div>

  2. #2
    Join Date
    Nov 2007
    Location
    USA
    Posts
    170
    Thanks
    8
    Thanked 22 Times in 22 Posts

    Default

    did you try to put the < a href = "top"> closer to the top of the page where you wanted it to take your users? i did a little test on my own and put the top of page link in my <head> section and it did it fine...maybe that will work?

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    <a href="javascript:window.scrollTo(0,0);">Top</a>
    The target method can work too, though this is simpler (but does require Javascript).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Nov 2007
    Location
    Maine USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by djr33 View Post
    <a href="javascript:window.scrollTo(0,0);">Top</a>
    The target method can work too, though this is simpler (but does require Javascript).
    May I ask you to please post the entire code to this solution. I did what you suggested and it works then breaks. When you say require java script is there something more I need to add besides what you have posted?

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Is there another way of doing this so that it goes right to the very top of the page including the header image as well.
    Put the link around the top element of the page.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Nov 2007
    Location
    Maine USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It's a beautiful thing.. Thank you.. Why is it the most simplest of things seem to stump one. The key word was.. "element".. so simple.

  7. #7
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    You can do this...
    Code:
    <html>
    <head>
    //All the goodies in here for your page...
    //More goodies IDK what you put in here...
    </head>
    <body>
    <a name="#Top" />
    </body>
    <html>
    Basically just place it like that, if that doesn't work... then do this instead of this:
    Code:
    Good:
    <a name="#top"> </a>
    If this don't work use above...
    <a name="#top" />
    Its case sensitive so be careful!
    Hope this helps

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Case sensitive? Just the name, itself.

    I'm not sure why that didn't work. Haven't used it myself. Appears to be a very simple code.

    Look at the link on this page, "[Jump to Top of Page]"

    I didn't do anything special to that, just copied the [pseudo] URL from that.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  9. #9
    Join Date
    Nov 2007
    Location
    USA
    Posts
    170
    Thanks
    8
    Thanked 22 Times in 22 Posts

    Default

    you are still having trouble with this problem grey? have none of these worked?

  10. #10
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    If a person has thanked the post, assume that the problem is fixed.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

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
  •