0
Good morning. I have 8 different variables with the same functions.
However, the functions assigned to these variables are equal.
I feel like I’m being repetitive in the code.
There is some way to declare them all at once and the function is written only once, but equivalent to all 8 Variables?
<script>
$(document).ready(function() {
var owl = $("#owl-demo");
owl.owlCarousel({
[700, 7],
[1000, 8],
[1200, 8],
[1400, 8],
[1600, 8]
],
});
var owl = $("#owl-demo2");
owl.owlCarousel({
[600, 5],
[700, 7],
[1000, 8],
[1200, 8],
[1400, 8],
[1600, 8]
],
});
var owl = $("#owl-demo3");
owl.owlCarousel({
[700, 7],
[1000, 8],
[1200, 8],
[1400, 8],
[1600, 8]
],
});
var owl = $("#owl-demo4");
owl.owlCarousel({
[1400, 8],
[1600, 8]
],
});
var owl = $("#owl-demo5");
owl.owlCarousel({
[1200, 8],
[1400, 8],
[1600, 8]
],
});
var owl = $("#owl-demo6");
owl.owlCarousel({
[1600, 8]
],
});
var owl = $("#owl-demo7");
owl.owlCarousel({
});
var owl = $("#owl-demo8");
owl.owlCarousel({
[1200, 8],
[1400, 8],
[1600, 8]
],
});
var owl = $("#owl-demo9");
owl.owlCarousel({
[450, 4],
[600, 5],
[700, 7],
[1000, 8],
[1200, 8],
[1400, 8],
[1600, 8]
],
});
});
</script>