我認(rèn)為類(lèi)似的問(wèn)題和案例之前已經(jīng)在另一個(gè)線程中得到了答案。我找到了一些可能對(duì)您有幫助的參考資料,我會(huì)給您一些連結(jié)。 stackoverflow 中的另一個(gè)執(zhí)行緒
您也可以使用以下 JS 程式碼:
$('.multi-item-carousel').carousel({ interval: false }); // for every slide in carousel, copy the next slide's item in the slide. // Do the same for the next, next item. $('.multi-item-carousel .item').each(function(){ var next = $(this).next(); if (!next.length) { next = $(this).siblings(':first'); } next.children(':first-child').clone().appendTo($(this)); if (next.next().length>0) { next.next().children(':first-child').clone().appendTo($(this)); } else { $(this).siblings(':first').children(':first-child').clone().appendTo($(this)); } });
免責(zé)聲明:這些答案/程式碼片段不是我的。我從 Maurice melchers 的 https://codepen.io/mephysto/pen/ZYVKRY 得到它