Results 1 to 3 of 3

Thread: Scroll To help! confused..

  1. #1
    Join Date
    Mar 2012

    Scroll To help! confused..

    Hi all!

    I have a little problem. I am making a basic website and I wanted a scrollto function but I have no idea how to start.

    I wanted that if you click on a link say for example "25th May" it would go to a different page where the text is but scroll or jump to that section.

    Does anyone have any ideas of how to go about this?

    Thanks in advance!

  2. #2
    Join Date
    May 2006
    Somewhere behind your screen
    you have to put the proper anchor in the next page markup - something like this:

    HTML Code:
    <a name="25_may"></a>
    and then add the name of this anchor as a part of url in the href attribute of the link on you first page:

    HTML Code:
    <a href="nextpage.htm#25_may">25th May</a>
    the part aftrer the # sign is called 'hash'.
    signature under construction

  3. #3
    Join Date
    Jan 2004
    chertsey, a small town s.w. of london, england.
    Hi there jamesy23,

    you do not need javascript to achieve this.

    Give an id - ( let's say id="may25" ) to an element, it does not necessarily have to be the a element,
    to which you wish to scroll, then use this code...
    <a href="the-new-page.html#may25">25th. May</a>
    Last edited by coothead; 05-13-2012 at 02:45 PM. Reason: spelling error

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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

Recent Articles