1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Code for clicking on a link and it makes you go to top of page?

Discussion in 'HTML & Website Design' started by Eskarina, Nov 3, 2006.

  1. #1
    Hello :)

    can anyone remember or help me find the code for when you click on a link - and instead of it taking you to another page, it makes your link start at the top of the page, from where that link/heading was? So in effect, you clicked on a heading in the middle of a page and then it becomes the top heading?

    I am crap at explaining things but I'll try:

    I am on a website with a long page and lots of headings, I click on one of the headings (whick are links as well) when I click on the heading/link, it makes the heading go right to the top of the same page, in the same window?

    I would google it, but would end up on a complete merry-go-round because I don't know what the search term should be :(
     
    Eskarina, Nov 3, 2006 IP
  2. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #2
    fryman, Nov 3, 2006 IP
    ramakrishna p and Eskarina like this.
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    Look at some of the pages on my playpen site (see sig). Many use just that artifact.

    cheers,

    gary
     
    kk5st, Nov 3, 2006 IP
    ramakrishna p and Eskarina like this.
  4. Eskarina

    Eskarina Guest

    Messages:
    608
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thankyou both :D that was easier than I thought it would be :p

    Next question ... can I apply this anchor point to a link that is already doing something else?

    I have used a css photo album code from dynamic drive - when I hover over a thumbnail it pops up the full-size picture.

    However :s by pictures are quite long and so some of them get lost below the taskbar. I'd like to make it so when someone actually clicks on the thumbnail, it also goes to the top of the page so they don't just get half the picture.

    I imagine it isn't possible - but if you know any different I'd love to know :D

    Many thanks to you both again - I'm sure I'll be over doing that 'new trick' everywhere for a few weeks now :rolleyes:
     
    Eskarina, Nov 4, 2006 IP
  5. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #5
    onclick="window.scrollTo(0,0); return false"

    Hows that?
     
    Silver89, Nov 4, 2006 IP
    Eskarina likes this.
  6. ramakrishna p

    ramakrishna p Notable Member

    Messages:
    1,798
    Likes Received:
    361
    Best Answers:
    0
    Trophy Points:
    240
    #6
    ramakrishna p, Nov 4, 2006 IP
  7. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #7
    What was the point of tht last post?
     
    Silver89, Nov 4, 2006 IP
  8. ramakrishna p

    ramakrishna p Notable Member

    Messages:
    1,798
    Likes Received:
    361
    Best Answers:
    0
    Trophy Points:
    240
    #8
    Are you asking here about my post?
    The point is..... when help is extended by any members of this forum and If I like the way of helping I will try to express my happiness. Recognizing someone's efforts with gratitude is not a pointless activity. Hope you understand this point.:)
     
    ramakrishna p, Nov 4, 2006 IP
    kk5st likes this.