I am facing the following coding challenge:
<div id = "parent">
<div id = "button"></div>
</div>
There is also a dynamically generated
<div id="list"></div>
I have successfully implemented this functionality:
$("#button").on("clicked",function(){
$("#parent").append(list)
$("#parent").animate({ "max-height": '300px' }, 500)
}
This code allows me to show the list div from the button's bottom and animate it as if dropping from top to bottom.
However, I now need a different approach that functions like this:
$("#button").on("clicked",function(){
$("#parent").prepend(list)
$("#parent").animate({ "max-height": '300px' }, 500)
}
The above code is not ideal because as the height increases, the div continues to drop down rather than rise up.
Could anyone suggest a solution for making the parent div's height rise up? Any help would be greatly appreciated!