jquery show / hide div on click even in a slideshow?

Posted by KnockKnockWhosThere on Stack Overflow See other posts from Stack Overflow or by KnockKnockWhosThere
Published on 2010-03-11T17:31:21Z Indexed on 2010/03/11 17:34 UTC
Read the original article Hit count: 245

Filed under:
|
|
|

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>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about combine