디스플레이테마 , 인카게임 수정

This commit is contained in:
hyeonggil
2024-07-01 23:26:33 +09:00
parent 27b98db968
commit 0a676da6d0
18 changed files with 264 additions and 42 deletions

View File

@@ -498,6 +498,9 @@ function pdpInCarGameSwiperDtl(){
}
flagScroll = false;
}
var beforeDtlImgPath = '';
$(document).on("click", ".inCarGame .dtthumb", function(e) {
const thumbIdx = e+1;
const dtlImgPath = $(this).attr("value");
@@ -520,13 +523,14 @@ $(document).on("click", ".inCarGame .dtthumb", function(e) {
const pathWithoutFileName = src.substring(0, lastIndex);
$(this).attr("src", `${pathWithoutFileName}/${dtlImgPath}-${idx}.png`);
});
$(".inCarGame .video-slide").each(function(e){
const idx = e+1;
const src = $(this).find(".themeVideo").attr("src");
const lastIndex = src.lastIndexOf("/");
const pathWithoutFileName = src.substring(0, lastIndex);
const videoEle = `
<video loop="" muted="" playsinline="" autoplay="" poster="${pathWithoutFileName}/${dtlImgPath}-1.png">
<video class="videos" loop="" muted="" playsinline="" autoplay="" poster="${pathWithoutFileName}/${dtlImgPath}-1.png">
<source src="${pathWithoutFileName}/${dtlImgPath}-1.mp4" type="video/mp4" class="themeVideo">
</video>
`;
@@ -534,7 +538,11 @@ $(document).on("click", ".inCarGame .dtthumb", function(e) {
// $(this).attr("src", `${pathWithoutFileName}/${dtlImgPath}-${idx}.mp4`);
});
$(".inCarGame .video-slideThumb").each(function(e){
$(this).removeClass(`${beforeDtlImgPath}`)
const idx = e+1;
const src = $(this).find(".themeVideo").attr("src");
const lastIndex = src.lastIndexOf("/");
@@ -544,6 +552,10 @@ $(document).on("click", ".inCarGame .dtthumb", function(e) {
<source src="${pathWithoutFileName}/${dtlImgPath}-1.mp4" type="video/mp4" class="themeVideo">
</video>
`;
$(this).addClass(`${dtlImgPath}`)
beforeDtlImgPath = dtlImgPath;
$(this).html(videoEle);
// $(this).attr("src", `${pathWithoutFileName}/${dtlImgPath}-${idx}.mp4`);