업로드
This commit is contained in:
@@ -173,13 +173,14 @@ $(document).ready(function() {
|
||||
spaceBetween: 20,
|
||||
freeMode: true,
|
||||
});
|
||||
|
||||
//PDP Display Theme
|
||||
let flagAutoPlay = true;
|
||||
var swiperTheme = new Swiper(".pdpDisplayThemeSwiper", {
|
||||
slidesPerView: "auto",
|
||||
loop:true,
|
||||
freeMode: true,
|
||||
autoplay: {
|
||||
pauseOnMouseEnter: true,
|
||||
delay:1,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
@@ -198,22 +199,49 @@ $(document).ready(function() {
|
||||
}
|
||||
},
|
||||
on: {
|
||||
init: function (swiper) {
|
||||
console.log('swiper initialized')
|
||||
var swiperContainer = document.querySelector('.swiper-container');
|
||||
|
||||
// Pause autoplay when mouse enters the Swiper container
|
||||
swiperContainer.addEventListener('mouseenter', function() {
|
||||
swiperTheme.autoplay.stop();
|
||||
});
|
||||
|
||||
// Resume autoplay when mouse leaves the Swiper container
|
||||
swiperContainer.addEventListener('mouseleave', function() {
|
||||
swiperTheme.autoplay.start();
|
||||
});
|
||||
init: function () {
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
$('.pdpDisplayThemeSwiper').hover(function(){
|
||||
if(flagAutoPlay==true){
|
||||
swiperTheme.autoplay.stop();
|
||||
}
|
||||
}, function(){
|
||||
if(flagAutoPlay==true){
|
||||
swiperTheme.autoplay.start();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click", ".dtthumb", function() {
|
||||
|
||||
const dtlImgPath = $(this).attr("value");
|
||||
const dtlImgs = $(".dtlImgs");
|
||||
$(this).parent().find("li").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
|
||||
$('.dtlImgs .item').addClass('change')
|
||||
setTimeout(function() {
|
||||
$('.dtlImgs .item').removeClass('change')
|
||||
}, 200);
|
||||
|
||||
$(".themeImg").each(function(e){
|
||||
const idx = e+1;
|
||||
const src = $(this).attr("src");
|
||||
const lastIndex = src.lastIndexOf("/");
|
||||
const pathWithoutFileName = src.substring(0, lastIndex);
|
||||
|
||||
$(this).attr("src", `${pathWithoutFileName}/${dtlImgPath}-${idx}.png`);
|
||||
});
|
||||
const visualBgSrc = $(".visualBg img").attr("src");
|
||||
const visualBgLastIndex = visualBgSrc.lastIndexOf("/");
|
||||
const visualBgPathWithoutFileName = visualBgSrc.substring(0, visualBgLastIndex);
|
||||
|
||||
$(".visualBg img").attr("src", `${visualBgPathWithoutFileName}/${dtlImgPath}_screen.jpg`);
|
||||
|
||||
flagAutoPlay = false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -445,38 +473,4 @@ $(document).on("click", ".lpthumb", function() {
|
||||
$(".lighting_pattern_movie").attr("src", $(this).attr("value"));
|
||||
$(".lighting_pattern_movie").load();
|
||||
$(".lighting_pattern_movie").play();
|
||||
});
|
||||
// PDP Lighting Pattern
|
||||
$(document).on("click", ".dtthumb", function() {
|
||||
const dtlImgPath = $(this).attr("value");
|
||||
const dtlImgs = $(".dtlImgs");
|
||||
$(this).parent().find("li").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
|
||||
$('.dtlImgs .item').addClass('change')
|
||||
setTimeout(function() {
|
||||
$('.dtlImgs .item').removeClass('change')
|
||||
}, 200);
|
||||
|
||||
|
||||
// AOS.refreshHard(); // Optional: Refresh AOS
|
||||
// AOS.init();
|
||||
|
||||
$(".themeImg").each(function(e){
|
||||
const idx = e+1;
|
||||
const src = $(this).attr("src");
|
||||
const lastIndex = src.lastIndexOf("/");
|
||||
const pathWithoutFileName = src.substring(0, lastIndex);
|
||||
|
||||
$(this).attr("src", `${pathWithoutFileName}/${dtlImgPath}-${idx}.png`);
|
||||
|
||||
});
|
||||
const visualBgSrc = $(".visualBg img").attr("src");
|
||||
console.log(visualBgSrc)
|
||||
const visualBgLastIndex = visualBgSrc.lastIndexOf("/");
|
||||
const visualBgPathWithoutFileName = visualBgSrc.substring(0, visualBgLastIndex);
|
||||
|
||||
$(".visualBg img").attr("src", `${visualBgPathWithoutFileName}/${dtlImgPath}_screen.jpg`);
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user