先在轮播图模板中隐藏默认的按钮,JS触发依然存在:
<div class="swiper-button-prev" style="display: none;"></div> <div class="swiper-button-next" style="display: none;"></div>
然后设置自己的按钮触发默认click:
$("#my_next").click(function(){ console.log(1); $('.swiper-button-next').trigger('click'); })