File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
2023-06-22
File name
Commit message
Commit date
File name
Commit message
Commit date
var main;
$(document).ready(function() {
/* content1 슬라이드 */
var mySwiper = new Swiper('.swiper2', {
slidesPerView: 4,
spaceBetween: 0,
speed : 600,
loop: true,
touchRatio: 0,//드래그 금지
autoplay: {
delay: 2500
},
pagination: {
el: '.swiper-pagination',
clickable: true,
},
navigation: {
nextEl: '.swiper2 .swiper-button-next',
prevEl: '.swiper2 .swiper-button-prev',
},
});
$(".banner_w .swiper-slide-next").find(".contWrap").addClass("on");
$(".banner_w .contWrap").mouseover(function(){
$(this).addClass("on");
$(this).parent().addClass("on");
$(this).parent().siblings().find(".contWrap").removeClass("on");
$("swiper-slide").removeClass("on");
if(!$(this).closest('.swiper-slide-next').hasClass('on')){
$(".swiper-slide-next").find(".contWrap").addClass('active');
}
mySwiper.autoplay.stop();
});
$(".banner_w .contWrap").mouseout(function () {
$(this).removeClass("on");
$(this).parent().removeClass("on");
$(this).parent().siblings().find(".contWrap").removeClass("on");
$(".swiper-slide-next").find(".contWrap").removeClass("active");
mySwiper.autoplay.start();
});
$(".banner_w .swiper-pagination").click(function(){
$(".contWrap").removeClass("on");
$(".swiper2 .contWrap").addClass("on");
});
$(".banner_w .swiper-button-next").click(function(){
$(".contWrap").removeClass("on");
$(".swiper2 .contWrap").addClass("on");
});
$(".banner_w .swiper-button-prev").click(function(){
$(".contWrap").removeClass("on");
$(".swiper2 .contWrap").addClass("on");
});
/*// content1 슬라이드 */
/* main visual */
var mainSwiper = new Swiper('.visual_swiper', {
effect: "fade",
slidesPerView: 1,
spaceBetween: 0,
speed : 400,
loop: true,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
pagination: {
el: '.swiper-pagination',
clickable: true,
},
navigation: {
nextEl: '.visual_swiper .swiper-button-next',
prevEl: '.visual_swiper .swiper-button-prev',
},
});
$(".slidePause").on('click',function(){ // 중지버튼 눌렀을때
if($(this).hasClass('active')){
mainSwiper.autoplay.start();
$(this).removeClass('active');
}else{
mainSwiper.autoplay.stop();
$(this).addClass('active');
}
});
/* //main visual */
/* 메인-문자샘플 탭 선택 시 활성화 */
/*$(".tab_depth1 a").click(function () {
alert("main.js");
var tabText = $(this).text();
var tabPosi = $(this).position().left;
var tabIdx = $(this).index();
console.log(tabIdx);
if(tabIdx == 0){
$(".on_active").css("border-radius", "5px 0 0 5px")
}else if(tabIdx == 2){
$(".on_active").css("border-radius", "0 5px 5px 0");
}else{
$(".on_active").css("border-radius", "0 0 0 0");
}
$(".on_active").text(tabText);
$(".on_active").css("left",tabPosi);
$(this).addClass("on");
$(this).siblings("a").removeClass("on");
//1depth 선택 시 2depth, 3depth 메뉴 첫번째로 이동
$(".tab_depth2 a:first-child").addClass("on");
$(".tab_depth2 a:first-child").siblings("a").removeClass("on");
$(".tab_depth3 a:first-child").addClass("on");
$(".tab_depth3 a:first-child").siblings("a").removeClass("on");
});*/
/*$(".tab_depth2 a").click(function () {
$(this).addClass("on");
$(this).siblings("a").removeClass("on");
//2depth 선택 시 3depth 메뉴 첫번째로 이동
$(".tab_depth3 a:first-child").addClass("on");
$(".tab_depth3 a:first-child").siblings("a").removeClass("on");
// 이전에 after 선 지우기.
if($(this).prev().is(".tab_prev") == false){
$(this).siblings().removeClass("tab_prev");
$(this).removeClass("tab_prev");
$(this).prev().addClass("tab_prev");
}
if($(this).is(".tab_custom") == true){
$(".tab_depth3.tab_other").show();
$(".tab_depth3.tab_basic").hide();
}else{
$(".tab_depth3.tab_other").hide();
$(".tab_depth3.tab_basic").show();
}
});*/
/*$(".tab_depth3.tab_other").hide();*/
$(".tab_depth3 a").click(function () {
$(this).addClass("on");
$(this).siblings("a").removeClass("on");
});
/* 단문문자, 포토문자 예시 */
if ($(".msg_photo").is(".active") == true) {
$(".btn_msg").css("display", "none");
} else {
$(".btn_photo").css("display", "block");
}
$(".tab_depth2 a:nth-child(1),.tab_depth2 a:nth-child(4)").click(function () {
$(".msg_photo").addClass("active");
$(".msg_text").removeClass("active");
$(".btn_photo").css("display", "block")
$(".btn_msg").css("display", "none")
})
$(".tab_depth2 a:nth-child(2),.tab_depth2 a:nth-child(3)").click(function () {
$(".msg_text").addClass("active");
$(".msg_photo").removeClass("active");
$(".btn_msg").css("display", "block")
$(".btn_photo").css("display", "none")
})
/* //content2 문자샘플 */
});
// content2 문자샘플 탭버튼
$(window).resize(function(){
var tabBtn = $(".main_cont2 .tab_con.active");
tabBtn.prev(".btn_prev").css("display","block");
tabBtn.next(".btn_next").css("display","block");
var tabBtnNot = tabBtn.siblings(".tab_con");
tabBtnNot.prev(".btn_prev").css("display","none");
tabBtnNot.next(".btn_next").css("display","none");
});