0

Ive seen this on a lot of sites lately, for example,

http://guides.rubyonrails.org/active_record_querying.html, where its one page, and one the side you have links, clicking them scrolls down to a specific section of the page.

I get that I can use jQuery to scroll to specific section of a page based on pixels/page height, but I notice that the url is also changing to mirror the id of the page section after a # sign? So like:

Clicking the 'retrieve a single object link' changes the url to:

http://edgeguides.rubyonrails.org/active_record_querying.html#retrieving-a-single-object

and scrolls down to that section

How is this implemented, (it would be helpful if you could provide an answer in the context of a ruby on rails application)?

TABISH KHAN
  • 1,553
  • 1
  • 19
  • 32

1 Answers1

0

This is simple HTML

  <a href="#Jumpy1">Click to jump to href</a>


  <a name="Jumpy1">It will jump to here</a>

Its an anchor, see: http://help.typepad.com/anchor-tags.html

Xavjer
  • 8,838
  • 2
  • 22
  • 42