디즈니 어드민에 맞춰 수정
This commit is contained in:
@@ -4,6 +4,41 @@ $(document).ready(function () {
|
||||
history.scrollRestoration = "manual";
|
||||
}
|
||||
|
||||
$(document).on("click", ".pdpDetail .tab-menu .tab-btn", function () {
|
||||
const $thisBtn = $(this);
|
||||
const $tabWrap = $(".pdpDetail .tab-wrap");
|
||||
const $tabBtns = $(".pdpDetail .tab-menu .tab-btn");
|
||||
const $tabContents = $(".pdpDetail .tab-box");
|
||||
const currentIndex = $tabBtns.index($thisBtn); // index 구하기
|
||||
const currentTabBtnText = $thisBtn.text();
|
||||
|
||||
// 탭 버튼 active 처리
|
||||
$tabBtns.closest("li").removeClass("active");
|
||||
$thisBtn.closest("li").addClass("active");
|
||||
|
||||
// 탭 콘텐츠 show/hide
|
||||
$tabContents.hide().eq(currentIndex).show();
|
||||
|
||||
// 스크롤 이동
|
||||
$("html, body").animate(
|
||||
{
|
||||
scrollTop: $tabWrap.offset().top - 60,
|
||||
},
|
||||
200
|
||||
);
|
||||
|
||||
// 모바일/태블릿 메뉴 닫기
|
||||
if ($("body").hasClass("moblie") || $("body").hasClass("tablet")) {
|
||||
$(".pdpDetail .tab-menu .btn-select").removeClass("open").text(currentTabBtnText);
|
||||
$(".pdpDetail .tab-menu ul").slideUp(200);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", ".pdpDetail .tab-menu .btn-select", function () {
|
||||
const $this = $(this);
|
||||
$this.toggleClass("open").next().slideToggle(200);
|
||||
});
|
||||
|
||||
//윈도우 사이즈 반응형에 따른 스크립트
|
||||
const body = document.querySelector("body");
|
||||
var targetSize = "";
|
||||
|
||||
Reference in New Issue
Block a user