Skip to content
Advertisement

smooth Nuxt/Vue transition on the rest of the page when displaying and hidding a list of elements

I got a list of grid items , and a button switching between “see more” and “see less”. On click on the “see more” button, all the list is displayed. on click on the see less, only 3 items are displayed. we got a nice transition when displaying all the items, but when we hide them, all the elements on the bottom don’t follow the motion. How can I make the transition smooth and don’t leave the user at the middle of the paragraphe ?

template exemple :

JavaScript

I used those css properties for the transition

JavaScript

the Script goes as follow :

JavaScript

https://jsfiddle.net/ghivalla/v5me216c/3/

Advertisement

Answer

Try this

JavaScript

https://jsfiddle.net/w4v9g6us/

Also here is a good place to read more about vue and transitions https://v2.vuejs.org/v2/guide/transitions.html

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement