I'm having a trouble when trying basic jquery animations (sliding, fading...) on a div by pushing a button, the issue is that when I push it the div does the animation (for example it slides up) and when it hides up the other divs are repositioned to fill the space where the other div was, what's the issue with my code? Is this normal when applying animations on jquery? Thanks :)
<body>
<h1>jQuery Test 01</h1>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<script>
$(function() {
$('.button1').html('<p>button 1</p>');
$('.button2').html('<p>button 2 </p>');
$('.button3').html('<p>button 3 </p>');
$('.button4').html('<p>button 4 </p>');
$('.button5').html('<p>button 5 </p>');
$('.button6').html('<p>button 6 </p>');
$('.button1').on('click', function() {
$('.div1').slideToggle();
});
$('.button2').on('click', function() {
$('.div2').slideToggle();
});
$('.button3').on('click', function() {
$('.div3').slideToggle();
});
$('.button4').on('click', function() {
$('.div4').slideToggle();
});
$('.button5').on('click', function() {
$('.div5').slideToggle();
});
$('.button6').on('click', function() {
$('.div6').slideToggle();
});
});
</script>
JSFiddle: http://jsfiddle.net/42knLk1n/30/