Animate display: none (and more!) with View Transitions

Published: 14 June 2023
on channel: Chrome for Developers
18,123
733

Write any CSS you want in the contenteditable pre and some JavaScript will tell the browser to start a view transition (take a before screenshot), apply the written styles to the page, then take an after screenshot and transition between the two states (whatever they are!).

Codepen demo → https://goo.gle/3Ps3hZx
View Transitions guide → https://goo.gle/3CqDHMB

GUI Snippets → https://goo.gle/GUIsnippets
GUI Challenges → https://goo.gle/GUIchallenges

Subscribe to Google Chrome Developers → https://goo.gle/ChromeDevs

#GUIsnippets


Watch video Animate display: none (and more!) with View Transitions online without registration, duration hours minute second in high quality. This video was added by user Chrome for Developers 14 June 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 18,123 once and liked it 733 people.