I have got to build a carousel dynamically from two arrays, as follows:
var arrayBarcode = [123456789, 234567891, 345678912];
var arrayPath = [/assets/image1.jpg, /assets/image2.jpg,/assets/image3.jpg];
To start with, i only have the div class flexslider
I need to build my ul li so that my final html outputs the following:
<div class="flexslider">
<ul class="slides">
<li ean="123456789">
<img src="/assets/image1.jpg" alt="pix" draggable="false">
<a data-statsaction="coupon-basket-remove" data-statscategory="coupon-buttons" title="Remove" href="#">
<i aria-hidden="true" class="icon icon-close-neg">
<span class="sr-only">Remove</span>
</i>
</a>
</li>
<li ean="234567891">
<img src="/assets/image2.jpg" alt="pix" draggable="false">
<a data-statsaction="coupon-basket-remove" data-statscategory="coupon-buttons" title="Remove" href="#">
<i aria-hidden="true" class="icon icon-close-neg">
<span class="sr-only">Remove</span>
</i>
</a>
</li>
<li ean="345678912">
<img src="/assets/image3.jpg" alt="pix" draggable="false">
<a data-statsaction="coupon-basket-remove" data-statscategory="coupon-buttons" title="Remove" href="#">
<i aria-hidden="true" class="icon icon-close-neg">
<span class="sr-only">Remove</span>
</i>
</a>
</li>
</ul>
Please note that the first item in arrayBarcode matches with the first item in arrayPath, etc..
Any help would much be appreciated..
Thanks..