Sidebar collapser… plugin?

I’ve had questions every now and then about how I do the sidebar collapsing thing (show / hide links) on my sidebar area. I have it running as a plugin, but I haven’t publicly released it yet (more on that later).

For those who don’t want to wait, you can always check out the SidebarCollapser.js file linked to this page; that’s really all there is to it. The file contains a script that will run when the page loads, and go through the sidebar and add the show/hide links to the appropriate sections.

One basic principle I try to adhere to is “unobtrusive javascript”, which means that the page should load and work fine if the browser does not support script (or has it disabled). The user should be able to use the basic functionality of the site without enabling javascript. Furthermore, (IMHO) they shouldn’t even see things that they can’t use, so the additional script-based functionality (in this case the show/hide links) should only even show up if their browser will be able to use them.

Like I said above, I’ve been thinking about packaging it up as a plugin, but I’m undecided about that since I don’t seem to have a lot of time lately to support and upgrade the ones I’ve already released, much less taking on new stuff. Aside from the time requirements for support, I’d also like to go through and refactor / clean up the code a bit before I’d release it anyway. Anyone is welcome to take it and adapt it to suit their own needs, but unfortunately I can’t take the time to package it up and release (and support) it as a plugin right now.

One Comment

  1. Posted November 9, 2006 at 8:30 pm | Permalink

    Very, very cool to learn about. Thanx JB — I wouldn’t want to add to your support load; it’s just very awesome to use… *clickity click click*

    All good things in time, I’m sure. :D

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*