metafizzy / flickity-fullscreen

Enable fullscreen view for Flickity carousels
46 stars 17 forks source link

Exit FullScreen Path Data #21

Open hieuvn opened 6 years ago

hieuvn commented 6 years ago

i like path data of FullScreen icon in sandbox (Fullscreen.html data='M0 32 V 20 H 4 v 8 h 8 v 4 Z m 32 0 V 20H28v8H20v4ZM0 0V12H4V4h8V0ZM20 0V4h8v8h4V0Z'), it's nine! could you share path data of exit fullscreen? Thanks.

desandro commented 6 years ago

You can overwrite SVG path with JavaScript


var flkty = new Flickity('.carousel', {
  fullscreen: true
});

var viewPath = flkty.viewFullscreenButton.element.querySelector('path');
viewPath.setAttribute( 'd', 'M0 32 V 20 H 4 v 8 h 8 v 4 Z m 32 0 V 20H28v8H20v4ZM0 0V12H4V4h8V0ZM20 0V4h8v8h4V0Z' );

var exitPath = flkty.exitFullscreenButton.element.querySelector('path');
exitPath.setAttribute( 'd', '....' );