I build a little Template and on this there is a Jssor Slider and the pictures on this Slider are in thumbnails too. By click on the thumbnail I want that this picture shows in the slider. How can i make that with Jquery.
The code at the moment:
var a_td_pic = [$("#tecdoc_bild1_thumb").attr("src"), $("#tecdoc_bild2_thumb").attr("src"), $("#tecdoc_bild3_thumb").attr("src"), $("#tecdoc_bild4_thumb").attr("src"),$("#hersteller_logo_thumb").attr("src")];
var a_ntd_pic = [$("#detailbild1_thumb").attr("src"), $("#detailbild2_thumb").attr("src"), $("#detailbild3_thumb").attr("src"), $("#detailbild4_thumb").attr("src"), $("#detailbild5_thumb").attr("src"),$("#hersteller_logo_thumb").attr("src")];
a_td = cleanArray(a_td_pic);
a_ntd = cleanArray(a_ntd_pic);
var check = [$("#tecdoc_bild1_thumb").attr("src"), $("#tecdoc_bild2_thumb").attr("src"), $("#tecdoc_bild3_thumb").attr("src"), $("#tecdoc_bild4_thumb").attr("src")];
if (check[0] == "" && check[1] == "" && check[2] == "" && check[3] == "") {
// Kein TecDoc
console.log("Kein TecDoc Bild");
$("#thumb").html("");
var i_3 = 0;
while (a_ntd[i_3]) {
console.log(a_ntd[i_3]);
$("#thumb").append('<div id="thumb_'+i_3+'"><img src="'+a_ntd[i_3]+'" class="thumb" /></div>');
i_3 ++;
}
if(a_ntd.length > 3) {
// Wenn mehr als 3 Bilder vorhanden sind wird auf Thumbnail Slider angepasst
}
var i_4 = 0;
while (a_td[i_4]) {
$("#thumb_"+i_4).click(function() {
});
i_4 ++;
}
}
else {
console.log("TecDoc Bild");
$("#thumb").html("");
var i_3 = 0;
while (a_td[i_3]) {
console.log(a_td[i_3]);
$("#thumb").append('<div id="thumb_'+i_3+'"><img src="'+a_td[i_3]+'" class="thumb"/></div>');
i_3 ++;
}
if(a_td.length > 3) {
// Wenn mehr als 3 Bilder vorhanden sind wird angepasst auf den Slider
}
var i_4 = 0;
while (a_td[i_4]) {
$("#thumb_"+i_4).click(function() {
$("#pic_"+i_4).css("left","0px");
});
i_4 ++;
}
}
Best regards
Given the 3rd thumbnail was clicked, please use the following code to display the 3rd slide.
jssor_slider1.$GoTo(2); //or jssor_slider1.$PlayTo(2);