// ==========================================================
// slide 設定
// ==========================================================
;(function($) {
const slideTarget = $('.slideshow')
if(slideTarget.children().length > 1) {
slideTarget.owlCarousel({
loop: true,
items: 1,
navText: ['',''],
dots: true,
autoplay: true,
animateOut: 'fadeOut',
autoplayTimeout: 9500,
autoplayHoverPause: true,
responsive: {
0: {
nav : false,
},
1025: {
nav : true,
},
},
})
}
})($)
// ==========================================================
// 常見問題開關
// ==========================================================
;(function($) {
// 子層開關
$('.faq-list').on('click', '.title', function(e) {
$(this).parent('.item').toggleClass('in-active')
.siblings('.item').removeClass('in-active')
})
})($)
// ==========================================================
// 細分類索引左右動
// ==========================================================
;(function($) {
$(window).on("resize", function(){
if(document.body.clientWidth > 660){
$(".anchor-list").owlCarousel({
loop: false,
dots: false,
responsive:{
660:{
items:3
},
840:{
items:4
},
1020:{
items:5
},
1140:{
items:6
}
}
});
if($(".anchor-list .owl-stage").width() > $(".owl-stage-outer").width()){
$(".right-caret").show()
}
}else{
$(".anchor-list").trigger("destroy.owl.carousel").addClass("owl-carousel")
$(".left-caret, .right-caret").hide()
}
})
$("#customRightCaret").on("click", function(){
$(".owl-carousel").trigger("next.owl.carousel")
$(".left-caret").show()
})
$("#customLeftCaret").on("click", function(){
$(".owl-carousel").trigger("prev.owl.carousel")
})
})($)
// 監聽細分類滑動時才顯示箭頭
//又要改 先保留
/*
function onSlide(){
$(".anchor-list").on("drag.owl.carousel",function(){
$(".left-caret").show()
})
$(".anchor-list").on("dragged.owl.carousel",function(){
$(".left-caret").hide()
})
}*/