Experiment with it. Try a class name.
   
  

blg002 <[EMAIL PROTECTED]> wrote:
  
I'm relatively new to jQuery & Javascript and was wondering if
someone could help me condense my code a little.

What I have going on is... multiple div's with different info in them
& an ordered list of links. Only one of the divs will display at a
time and they can be toggled through by clicking on the corresponding
link.

HTML:
  
  
  Lorem Ipsum One




  
  Lorem Ipsum Two




  
  Lorem Ipsum Thre




  
  
   1
  
   2
  
   3





JQuery:
$("#branding ol li:nth-child(1) a").click(function() {
$("#branding div").attr('id', 'one');
});

$("#branding ol li:nth-child(2) a").click(function() {
$("#branding div").attr('id', 'two');
});

$("#branding ol li:nth-child(3) a").click(function() {
$("#branding div").attr('id', 'three');
});

Here is a quick demo page...
http://demonstration.dev.matrixgroup.net/brad/toggle/

Thanks for any help,

brad


       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Reply via email to