views:

345

answers:

1

Is it possible to combine a slideshow and show / hide div functionality?

My html structure is below, and basically, I'm trying to get the tabs > a links to open up the div with the corresponding class if a user clicks on it. If a user doesn't click on it, it should still just cycle through each image. So, if the images are rotating, and I click on <a class="t2"> then would open. The thing is, it's unknown how many divs / tabs there will be, but they'll always be named t{n}.

<div id="tab-content">
   <div class="t1">content</div>
   <div class="t2">lorem ipsum</div>
   <div class="t3">knock knock</div>
</div>

<div id="nav">
   <div id="tabs">
      <ul>
         <li class="t1"><a class="t1" href="#">tab 1</a></li>
         <li class="t2"><a class="t2" href="#">tab 2</a></li>
         <li class="t3"><a class="t3" href="#">tab 3</a></li>
      </ul>
   </div>
</div>
A: 
Gaby
That doesn't actually do what I need it to do. It doesn't cycle through the images automatically, and it doesn't hide the content that doesn't have the same class... Am I missing something?
TwixxyKit
oh .. thought you had a problem with the part of opening the div with the same class as the link ... updated answer to point to a plugin that does what you want..
Gaby