Kod z demo z animacja:
Kod
$(document).ready(function() {
// LEFT COLUMN:
// When the collapse button is clicked:
$('.collapseLeft').click(function() {
$('.collapseLeft').css("display","none");
$('.expandLeft').css("display","block");
$('#leftCol').animate( {height:"20px"}, {duration:400} );
});
// When the expand button is clicked:
$('.expandLeft').click(function() {
$('.expandLeft').css("display","none");
$('.collapseLeft').css("display","block");
$('#leftCol').animate( {height:"500px"}, {duration:500} );
});
// RIGHT COLUMN:
// When the collapse button is clicked:
$('.collapseRight').click(function() {
$('.collapseRight').css("display","none");
$('.expandRight').css("display","block");
$('#rightCol').animate( {height:"20px"}, {duration:400} );
});
// When the expand button is clicked:
$('.expandRight').click(function() {
$('.expandRight').css("display","none");
$('.collapseRight').css("display","block");
$('#rightCol').animate( {height:"500px"}, {duration:500} );
});
});
W tym pierwszym linku masz gotowy kod z ciasteczkami, co za problem skopiowac i zmienic nazwy elemtow jesli masz inne ? Jak juz to wklej swoj kod.