我想获取标签options
中的数量select
,然后从中生成相同数量的图像路径。
$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…]
});
}