1
I have a div
which serves as a shopping cart, it is fixed at the top of the screen where only the subtotal
of all products chosen and by clicking on the div
, she makes a slide down effect and shows all the products.
I did the effect of slide
animated in css
, and I leave the div
fixed at the top with Top negative, according to the size of the div, for example, top: -370px
.
The problem is that the size of the div
is dynamic, increases as products are added, so even with the top negative, div does not 'hide' all products. I’ve tried changing the top property as the add product buttons are clicked, which works, but I don’t know how to change the top of the animation that makes go down and up the div.
Does anyone know if there’s a way to change this property or if there’s a better way to do it?
To make it easier to understand: https://jsfiddle.net/84rczeds/2/
You can simplify your stroller a lot.
– Bruno Romualdo
So I want to leave the animations only in css, but I think I ended up complicating too much even haha
– Felipe Evangelista