I have a practice site where I've been playing around with some jquery. Check it out here:
It functions ok and if you click a button, the image slides down as it should. How can I make it so that if the image is down already and you click another button, that respective image will slide down too instead of the previous one sliding up first
Here's my script:
- $(function(){
- $('#menu-container').hide();
-
- $('#box1').hide();
- $('#button1').click(function(){
- $('#menu-container, #box1').slideToggle('medium');
-
- });
-
- $('#box2').hide();
- $('#button2').click(function(){
- $('#menu-container, #box2').slideToggle('medium');
- });
-
- $('#box3').hide();
- $('#button3').click(function(){
- $('#menu-container, #box3').slideToggle('medium');
- });
-
- $('#box4').hide();
- $('#button4').click(function(){
- $('#menu-container, #box4').slideToggle('medium');
- });
- });