merge master into develop - CscListRForm.jsp FAQ 아코디언 버그 수정
This commit is contained in:
31
build/resources/main/static/sopmall/mobile/js/common.js
Normal file
31
build/resources/main/static/sopmall/mobile/js/common.js
Normal file
@@ -0,0 +1,31 @@
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
// 서브 탭 메뉴 타입 2
|
||||
var boxTabs = document.querySelectorAll(".boxTab__tabBtn");
|
||||
var contents = document.querySelectorAll(".boxTab__content");
|
||||
|
||||
function resetBoxTabs() {
|
||||
boxTabs.forEach(function(tab) {
|
||||
tab.closest("li").classList.remove("active");
|
||||
});
|
||||
contents.forEach(function(content) {
|
||||
content.classList.remove("current");
|
||||
});
|
||||
}
|
||||
|
||||
boxTabs.forEach(function(tab, index) {
|
||||
tab.addEventListener("click", function() {
|
||||
resetBoxTabs();
|
||||
tab.closest("li").classList.add("active");
|
||||
contents[index].classList.add("current");
|
||||
});
|
||||
});
|
||||
|
||||
// 상단 이동 스크롤 버튼
|
||||
const scrollToTop = document.querySelector(".quick-menu__to-top > button");
|
||||
|
||||
scrollToTop.addEventListener('click', function () {
|
||||
window.scrollTo({top: 0, behavior: 'smooth'});
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user