Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
add alt + h2 for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmester committed Mar 10, 2020
1 parent cd512f2 commit 6abbae8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/demo.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,32 @@ <h1>A11y Carousel</h1>
<div id="my-slider">
<div>
<a href="#">
<img src="https://i.picsum.photos/id/1057/970/400.jpg" alt="" />
<h2>Photo 0</h2>
<img src="https://i.picsum.photos/id/1057/970/400.jpg" alt="photo 0" />
</a>
</div>
<div>
<a href="#">
<img src="https://i.picsum.photos/id/605/970/400.jpg" alt="" />
<h2>Photo 1</h2>
<img src="https://i.picsum.photos/id/605/970/400.jpg" alt="photo 1" />
</a>
</div>
<div>
<a href="#">
<img src="https://i.picsum.photos/id/218/970/400.jpg" alt="" />
<h2>Photo 2</h2>
<img src="https://i.picsum.photos/id/218/970/400.jpg" alt="photo 2" />
</a>
</div>
<div>
<a href="#">
<img src="https://i.picsum.photos/id/419/970/400.jpg" alt="" />
<h2>Photo 3</h2>
<img src="https://i.picsum.photos/id/419/970/400.jpg" alt="photo 3" />
</a>
</div>
<div>
<a href="#">
<img src="https://i.picsum.photos/id/1054/970/400.jpg" alt="" />
<h2>Photo 4</h2>
<img src="https://i.picsum.photos/id/1054/970/400.jpg" alt="photo 4" />
</a>
</div>
</div>
Expand Down
9 changes: 4 additions & 5 deletions src/a11y-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
};

/**
Expand Down
3 changes: 3 additions & 0 deletions src/demo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,7 @@ button {
right: 0;
bottom: 0;
text-align: center;
}
h2 {
text-align: center;
}

0 comments on commit 6abbae8

Please sign in to comment.