To achieve this effect, it is not possible to use the slideToggle function. Instead, you can utilize the animate function. Check out this example.
When the button is clicked, a class named toggled is added to a div with the ID numbers, causing its height to shrink to 100px. Clicking the button again will remove the toggled class and increase the height back to 200px.
$("#toggle").click(function(e) {
e.preventDefault();
if($("#numbers").hasClass("toggled")) {
$("#numbers").animate({"height": "200px"}).removeClass("toggled");
} else {
$("#numbers").animate({"height": "100px"}).addClass("toggled");
}
});