jQuery tab technique

Out of context: Reply #5

  • Started
  • Last post
  • 11 Responses
  • gregorywieber0

    For something simple like this, I'd recommend coding it from scratch rather than using a plugin if you're interested in learning more jquery in the process. The key to this kind of stuff is to start with semantic html, like an unordered list. You can use children() on a selector, to return for instance all of the list items in that list. If you're using HTML5, you can use attributes like data-id or data-myUniqueIdentifier on your list item tags, and give the same id's to your tabs. Then, it's just simple click and mouseover functions that hide all of the list items and then show the one with the matching id.

View thread