Simplify my jQuery
Simplify my jQuery
Hey!
I'm fairly new to jQuery and I have a rather simple question.
I'm making a accordion-like solution to sign up for a subscription, and what I have now is:
- $(function() {
- $('.next').click(function() {
- $('.content_1').fadeOut({display: 'none'});
- $('.content_2').fadeIn({display: 'block'}, {duration:3000, queue: true});
- $('.footer_1').animate({width: '14px'}, 'slow');
- $('.footer_2').animate({width: '561px'}, 'slow');
- });
- $(function() {
- $('.next2').click(function() {
- $('.content_2').fadeOut({display: 'none'});
- $('.content_3').fadeIn({display: 'block'}, {duration:3000, queue: true});
- $('.footer_2').animate({width: '14px'}, 'slow');
- $('.footer_3').animate({width: '561px'}, 'slow');
- });
And so it continues for 5 more "pages"
Is there a way to make this with only one single "block" of code ?
Regards