Much nicer. Thanks for the tip!
On Thu, Apr 2, 2009 at 1:43 PM, mkmanning wrote:
>
> Actually there's an easier way as long as the links and the items
> being hidden/show have a one-to-one relationship.
>
> $(document).ready(function(){
> var a = $('ul.selector li a'), div = $('div.youtube').ch
Actually there's an easier way as long as the links and the items
being hidden/show have a one-to-one relationship.
$(document).ready(function(){
var a = $('ul.selector li a'), div = $('div.youtube').children
('div');
a.click(function(){
$(div.hide().get(a.index(this))).show();
First, I'd change the HTML to:
one
two
three
1
2
3
You should use IDs instead of classes because you want to target a
specific element. I left the "selector" class be
3 matches
Mail list logo