jQuery Toggle with multiple unique DIVs?
Posted
by tony noriega
on Stack Overflow
See other posts from Stack Overflow
or by tony noriega
Published on 2010-03-30T17:06:41Z
Indexed on
2010/03/30
17:13 UTC
Read the original article
Hit count: 395
I am using jQuery toggle with a link and a div. I will eventually have approx. 50 divs i want to toggle, and instead of creating a new function for each one, is there a way i can create a class and have it read unique ID's for each div? (if that makes sense)
For instance, i will have A1, A2, A3, B1, B2, B3..e.tc..
$(document).ready(function() {
$('#slickbox').hide();
$('a#slick-toggleA1').click(function() {
$('#A1').toggle(300);
return false;
});
});
© Stack Overflow or respective owner