Monday, March 26, 2012

Quickly navigating within your pages with the static sidebar

I was quite chuffed when I added the automatic table of contents to WikiPack’s sidebar, and showed it off proudly to my wife who promptly observed that when jumping to a section of the page the causes it to scroll down far enough, the TOC scrolls up with it and vanishes…

So I started work on some JavaScript to implement the fairly ubiquitous “sticky sidebar” seem around the web these days. It took a while to come up with a solution that I liked, and here it is:

~~~

It’s not just cosmetic, it serves some important practical purposes:

  • the search box is always visible for quickly jumping between pages
  • the edit button is accessible when viewing the bottom of a long document
  • the sidebar controls remain visible when loading a page with an anchor in the URL
  • it makes the TOC really fun to use!

Couple of other tweaks

The search box has been refined since the last post, and the WikiWords are no longer split up at the suggestion of @frosty. (It was displaying iOS as “i O S”)

Thank you to everyone who takes the time to send in questions, comments, and feature requests. There has been quite a bit of demand for a few things that I’ll be working on next (in no particular order):

  • Having a list of all pages in the sidebar
  • Setting a default home page
  • Marking pages as favourites

One of my long-term features that I’m planning is a solution to the “emailing links to myself” problem, but that’s another story…

No comments:

Post a Comment