I have a div
that serves as a product cart, it stays fixed at the top of the screen where only subtotal
of all the chosen products appears and clicking on div
, it does a slide down and show all products.
I made the effect of slide
with animation in css
, and I leave div
fixed on top with negative top, according to the size of the div, for example, top: -370px
. >
The problem is that the size of div
is dynamic, increases as products are added, so even with the negative top, the div does not 'hide' all products. I have tried to go changing the top property as the add product buttons are clicked, which works fine, however I do not know how to change the top of the animation that makes it go down and up the div.
Does anyone know if you can change this property or if there is a better way to do this?
To make it easier to understand: link