//메인 상단 배너 이미지
const ms1_swiper = new Swiper(".ms1_swiper", {
loop: true,
speed:500,
effect : 'fade',
autoplay: {
delay: 4000,
disableOnInteraction: false,
},
navigation: {
nextEl: '.ms1_swiper .next_btn',
prevEl: '.ms1_swiper .prev_btn',
},
pagination: {
el: '.ms1_swiper .ms1_pag',
clickable: true,
},
});
//메인 프로모션
const ms2_swiper = new Swiper(".ms2_swiper", {
//loop: true,
speed:500,
grabCursor: true,
slidesPerView: 2.2,
spaceBetween: 10,
//autoplay: {
// delay: 4000,
// disableOnInteraction: false,
//},
breakpoints: {
1025: {
slidesPerView: 4.15,
}
},
});
//메인 신상품
const ms3_swiper = new Swiper(".ms3_swiper", {
loop: true,
speed:500,
grabCursor: true,
slidesPerView: 3,
spaceBetween: 20,
//autoplay: {
// delay: 4000,
// disableOnInteraction: false,
//},
scrollbar: {
el: '.ms3_swiper .ms3_scrollbar',
draggable: true,
},
breakpoints: {
1025: {
slidesPerView: 5,
spaceBetween: 30,
}
},
});
function calculateDiscount() {
var discountElements = document.querySelectorAll('.discount');
discountElements.forEach(function (element) {
var custom = element.getAttribute('data-custom');
var price = element.getAttribute('data-price');
custom = parseInt(custom.replace(/,/g, ''));
price = parseInt(price.replace(/,/g, ''));
var rate = 0;
if (!isNaN(custom) && !isNaN(price) && custom > 0) {
rate = Math.round((custom - price) / custom * 100);
}
if (rate > 0) {
element.innerHTML = rate + '%';
element.style.textDecoration = "none";
element.classList.add("sale_on");
}
element.removeAttribute('data-custom');
element.removeAttribute('data-price');
});
}
document.addEventListener('DOMContentLoaded', function () {
calculateDiscount();
});
$(document).ready(function(){
$('#span_product_price_text').parent('span').parent('td').parent('tr').css('padding', '50px 0 5px');
$('#span_mileage_text').parent('span').parent('td').parent('tr').css('padding', '0 0 25px');
});
$(document).ready(function() {
Blist();
});
$(window).resize(function() {
Blist();
});
function Blist() {
$('.menu_list_top a').hover(
function(){
var SubclassN = $(this).text();
var Subclass = '.'+SubclassN+'_sub'
/*$('.menu_list .menuCategory li a').text(Subclass);*/
$('.menu_list .menuCategory li').find(Subclass).css('color', '#8f9f7b');
},
function(){
var SubclassN = $(this).text();
var Subclass = '.'+SubclassN+'_sub'
$('.menu_list .menuCategory li').find(Subclass).css('color', '#000');
});
}
/*
$('.menuCategory a.sub_open').click(function () {
$(this).css('display', 'none');
$(this).parent('.xans-product-children').children('li').slideDown();
$(this).parent('.xans-product-children').children('a.sub_close').css('display', 'inline-block');
});
$('.menuCategory a.sub_close').click(function () {
$(this).css('display', 'none');
$(this).parent('.xans-product-children').children('li').slideUp();
$(this).parent('.xans-product-children').children('a.sub_open').css('display', 'inline-block');
});
*/
$('.menuCategory a.sub_open').click(function () {
$('.xans-product-children').children('.product_children_in').slideUp();
$(this).parent('.xans-product-children').children('.product_children_in').slideDown();
$('.menuCategory a.sub_open').css('display', 'inline-block');
$(this).parent('.xans-product-children').children('.menuCategory a.sub_open').css('display', 'none');
$('.menuCategory a.sub_close').css('display', 'none');
$(this).parent('.xans-product-children').children('.menuCategory a.sub_close').css('display', 'inline-block');
});
$('.menuCategory a.sub_close').click(function () {
$(this).parent('.xans-product-children').children('.product_children_in').slideUp();
$(this).parent('.xans-product-children').children('.menuCategory a.sub_open').css('display', 'inline-block');
$(this).parent('.xans-product-children').children('.menuCategory a.sub_close').css('display', 'none');
});
$('.btn_menu a.open').click(function () {
$(this).css('display', 'none');
$('.btn_menu a.close').css('display', 'inline-block');
$('.top_sub#member_menu_sub').css('display', 'inline-block');
});
$('.btn_menu a.close').click(function () {
$(this).css('display', 'none');
$('.btn_menu a.open').css('display', 'inline-block');
$('.top_sub#member_menu_sub').css('display', 'none');
});
$('#footer .btn_open a.open').click(function () {
$(this).css('display', 'none');
$('#footer .btn_open a.close').css('display', 'inline-block');
$('#footer .hide_cominfo').slideDown();
});
$('#footer .btn_open a.close').click(function () {
$(this).css('display', 'none');
$('#footer .btn_open a.open').css('display', 'inline-block');
$('#footer .hide_cominfo').slideUp();
});
$('#bottom_info .section a.btn_more').click(function () {
$(this).parent('.section').children('ul').css('max-height', '1000px');
$(this).css('display', 'none');
$(this).parent('.section').children('a.btn_close').css('display', 'inline-block');
});
$('#bottom_info .section a.btn_close').click(function () {
$(this).parent('.section').children('ul').css('max-height', '130px');
$(this).css('display', 'none');
$(this).parent('.section').children('a.btn_more').css('display', 'inline-block');
});
/**
* 움직이는 배너 Jquery Plug-in
* @author cafe24
*/
;(function($){
$.fn.floatBanner = function(options) {
options = $.extend({}, $.fn.floatBanner.defaults , options);
return this.each(function() {
var aPosition = $(this).position();
var node = this;
$(window).scroll(function() {
var _top = $(document).scrollTop();
_top = (aPosition.top < _top) ? _top : aPosition.top;
setTimeout(function () {
$(node).stop().animate({top: _top}, options.animate);
}, options.delay);
});
});
};
$.fn.floatBanner.defaults = {
'animate' : 500,
'delay' : 500
};
})(jQuery);
/**
* 썸네일 이미지 엑박일경우 기본값 설정
*/
$(window).load(function() {
$("img.thumb,img.ThumbImage,img.BigImage").each(function($i,$item){
var $img = new Image();
$img.onerror = function () {
$item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif";
}
$img.src = this.src;
});
});
function winPop(a){window.open(a,"popup","width=300,height=300,left=10,top=10,resizable=no,scrollbars=no")}function getQueryString(d){var b=document.location.search.substring(1);var e={};if(b){var f=b.split("&");var c=[];for(var a=0;a'+a+"")}else{var b=$(this).attr("href");$(this).parent().html(''+a+"")}})}function favoritemark(){window.external.AddFavorite("http://www.tbof.co.kr","The beginning of Fortune - 행운의시작")}function onopen(){var a="http://www.ftc.go.kr/info/bizinfo/communicationViewPopup.jsp?wrkr_no="+ftc.wrkr_no.value;window.open(a,"communicationViewPopup","width=700, height=500;")}function MM_swapImgRestore(){var d,b,c=document.MM_sr;for(d=0;c&&d0&&parent.frames.length){e=parent.frames[f.substring(c+1)].document;f=f.substring(0,c)}if(!(a=e[f])&&e.all){a=e.all[f]}for(b=0;!a&&b100){$("#floatTop,#footerSitemapTop").fadeIn()}else{$("#floatTop,#footerSitemapTop").fadeOut()}});$("#floatTop,#footerSitemapTop").click(function(){$("html, body").animate({scrollTop:0},800);return false})});function go_check(){var a="width=500 height=450 menubar=no,scrollbars=no,resizable=no,status=no";var b=window.open("","kcp_pop",a);document.shop_check.method="post";document.shop_check.target="kcp_pop";document.shop_check.action="http://admin.kcp.co.kr/Modules/escrow/kcp_pop.jsp";document.shop_check.submit()}function onPopKBAuthMark(){window.open("","KB_AUTHMARK","height=604, width=648, status=yes, toolbar=no, menubar=no, location=no");document.KB_AUTHMARK_FORM.action="http://escrow1.kbstar.com/quics";document.KB_AUTHMARK_FORM.target="KB_AUTHMARK";document.KB_AUTHMARK_FORM.submit()};
/**
* 카테고리 마우스 오버 이미지
* 카테고리 서브 메뉴 출력
*/
$(document).ready(function(){
var methods = {
aCategory : [],
aSubCategory : {},
get: function()
{
$.ajax({
url : '/exec/front/Product/SubCategory',
dataType: 'json',
success: function(aData) {
if (aData == null || aData == 'undefined') return;
for (var i=0; i');
$(methods.aSubCategory[iCateNo]).each(function() {
aHtml.push(''+this.name+'');
});
aHtml.push('');
var offset = $(overNode).offset();
$('')
.appendTo(overNode)
.html(aHtml.join(''))
.find('li').mouseover(function(e) {
$(this).addClass('over');
}).mouseout(function(e) {
$(this).removeClass('over');
});
},
close: function() {
$('.sub-category').remove();
}
};
methods.get();
$('.xans-layout-category li').mouseenter(function(e) {
var $this = $(this).addClass('on'),
iCateNo = Number(methods.getParam($this.find('a').attr('href'), 'cate_no'));
if (!iCateNo) {
return;
}
methods.show($this, iCateNo);
}).mouseleave(function(e) {
$(this).removeClass('on');
methods.close();
});
});