Skip to content

Commit

Permalink
Update head.html
Browse files Browse the repository at this point in the history
only animate indexCarousel if not null
  • Loading branch information
bwbohl committed Dec 6, 2022
1 parent 7c89d97 commit 5d500e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<script type="text/javascript" src="/js/carousel.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", event => {
animateCarousel(document.getElementById("index-carousel"), 3000);
const indexCarousel = document.getElementById("index-carousel");
if (indexCarousel !== null) {
animateCarousel(indexCarousel, 3000);
}
});
</script>
</head>

0 comments on commit 5d500e2

Please sign in to comment.