Creating a Better Tabbed Interface in Django
Posted
by
ygd
on Stack Overflow
See other posts from Stack Overflow
or by ygd
Published on 2010-12-27T02:46:29Z
Indexed on
2010/12/27
2:54 UTC
Read the original article
Hit count: 216
I've been trying to create a tabbed interface using Django. The current effort (which works fine) is having each template have the header hard-coded in, with the selected tab given the "selected" CSS attribute. Of course, this is a massive violation of DRY and I'm looking to remedy it.
My current idea is adding a jQuery script to the page that looks at all the tabs and sets one to "selected" if it's text matches the beginning of the title for the page. Is there a better way to do this without using JavaScript and just pure CSS?
© Stack Overflow or respective owner