diff --git a/dist/demo.css b/dist/demo.css index a9cf06e..62a7707 100644 --- a/dist/demo.css +++ b/dist/demo.css @@ -1 +1 @@ -body{font-family:sans-serif;background:#eef4fb;color:#0c125c;max-width:900px}ul{margin:0;padding:0}ul li{display:block;padding:0;margin:0}img{display:block;width:100%}button:focus{outline:3px solid #ffa500}button{cursor:pointer;display:inline-block;margin:4px;background:#ddd;border:1px solid black;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:.7rem 1.5rem}button.active{background:#555;color:#fff}.custom-class{position:relative}#my-slider-play{position:absolute;z-index:10;top:0;left:0}#my-slider-prev{position:absolute;z-index:10;top:50%;left:0;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}#my-slider-next{position:absolute;z-index:10;top:50%;right:0;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.dots{position:absolute;z-index:10;left:0;right:0;bottom:0;text-align:center} \ No newline at end of file +body{font-family:sans-serif;background:#eef4fb;color:#0c125c;max-width:900px}ul{margin:0;padding:0}ul li{display:block;padding:0;margin:0}img{display:block;width:100%}button:focus{outline:3px solid #ffa500}button{cursor:pointer;display:inline-block;margin:4px;background:#ddd;border:1px solid black;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:.7rem 1.5rem}button.active{background:#555;color:#fff}.custom-class{position:relative}#my-slider-play{position:absolute;z-index:10;top:0;left:0}#my-slider-prev{position:absolute;z-index:10;top:50%;left:0;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}#my-slider-next{position:absolute;z-index:10;top:50%;right:0;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.dots{position:absolute;z-index:10;left:0;right:0;bottom:0;text-align:center}h2{text-align:center} \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 61495e8..8709433 100644 --- a/dist/index.html +++ b/dist/index.html @@ -12,27 +12,32 @@

A11y Carousel

- +

Photo 0

+ photo 0
- +

Photo 1

+ photo 1
- +

Photo 2

+ photo 2
- +

Photo 3

+ photo 3
- +

Photo 4

+ photo 4
diff --git a/src/a11y-carousel.js b/src/a11y-carousel.js index 44ea98c..1c5b950 100644 --- a/src/a11y-carousel.js +++ b/src/a11y-carousel.js @@ -356,12 +356,11 @@ class A11yCarousel { this.setSize(); } else { this.setSize(); + // If there's imgs and when need to wait them + imgs[imgs.length-1].addEventListener('load', () => { + this.setSize(); + }); } - - // If there's imgs and when need to wait them - imgs[imgs.length-1].addEventListener('load', () => { - this.setSize(); - }); }; /** diff --git a/src/demo.scss b/src/demo.scss index 8a41d61..1c9158f 100644 --- a/src/demo.scss +++ b/src/demo.scss @@ -65,4 +65,7 @@ button { right: 0; bottom: 0; text-align: center; +} +h2 { + text-align: center; } \ No newline at end of file