I would like to get the number of options in a select tag and then generate the same number of image paths from that.
$optionIndex = $("option", "select").index; // 2
imagePath = "/images/slider/slide-"
$images = "[" + imagePath + $optionIndex + ".jpg" + "]";
$(window).load(function() {
var $slider = $(".slider").slider({
images: $images // ideally this would show ["image1.jpg", "image2.jpg" etc…]
});
}
forloop or$.map().