I enjoy enhancing webpages with Javascript as much as anyone, but there is a lot to be said for making things function just as well with plain ole’ HTML. Recently, I was marking up a design that included a box on the homepage that toggled between 2 states. I could have made the non-javascript fallback simply link to a modified version of the homepage that showed one or the other, but that would require an unnecessary page refresh. Instead, I put both sets of information in a div with overflow set to hidden. I then used anchor links to slide the contents of the div up and down to show the selected information. Confused? Check out the anchor link toggle demo.
I’m certain this isn’t an original idea, but I haven’t ever seen anyone blog about it…probably because I don’t even really know what this technique should be called. Accessible toggle boxes, sliding anchor content, fairy-dustless slight of hand? Help me out here.