I want to know if there is a better way to make these hand coded function calls dynamic?
<div id="sing-mobile-1">.....</div>
<div id="sing-mobile-2">.....</div>
var signCarousel1 = document.getElementById("sing-mobile-1");
var signCarousel2 = document.getElementById("sing-mobile-2");
if (signCarousel1) {
var initializeSignpostCarousel = sequence(signCarousel1, options);
}
if (signCarousel2) {
var initializeSignpostCarousel = sequence(signCarousel2, options);
}
There may also be #sign-mobile-3
, #sign-mobile-4
, etc. It doesn't look clean in this way. Can someone guide me to solve this issue?