Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 1.1 KB

README.md

File metadata and controls

30 lines (18 loc) · 1.1 KB

This is a JavaScript practice with JavaScript30 by Wes Bos without any frameworks, no compilers, no boilerplate, and no libraries.

05 - Flex Panels Image Gallery

view demo here

CSS flex, toggle(), includes(), transitionend

CSS flex

CSS Flexible box layout

there are bunch of articles about CSS flexbox layout, and I hightly recommend this one written by Chris Coyier on CSS-Tricks if you are new to this fearture.

includes()

Safari transitionend event.propertyName === flex */

Chrome + FF transitionend event.propertyName === flex-grow */

due to there are different words between browsers, so we use .includes() to find the key word 'flex' here, for matches them.

if (e.propertyName.includes('flex')) {
  this.classList.toggle('open-active');
}