// 썸네일 이미지 엑박일경우 기본값 설정 $(window).load(function() { $(".thumbnail img, 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; }); }); $(document).ready(function(){ // 토글 $('div.eToggle .title').click(function(){ var toggle = $(this).parent('.eToggle'); if(toggle.hasClass('disable') == false){ $(this).parent('.eToggle').toggleClass('selected') } }); $('dl.eToggle dt').click(function(){ $(this).toggleClass('selected'); $(this).next('dd').toggleClass('selected'); }); //장바구니 페이지 수량폼 Type 변경 $('[id^="quantity"]').each(function() { $(this).get(0).type = 'tel'; }); // 모바일에서 공급사 테이블 th 강제조절 $('.xans-mall-supplyinfo, .supplyInfo').find('table > colgroup').find('col').eq(0).width(98); $('.xans-mall-supplyinfo, .supplyInfo').find('th, td').css({padding:'13px 10px 12px'}); /** * 메인카테고리 toggle */ $('.xans-product-listmain h2').toggle(function(){ $(this).css('background-image', 'url("//img.echosting.cafe24.com/skin/mobile_ko_KR/layout/bg_title_open.gif")'); $(this).siblings().hide(); $(this).parent().find('div.paginate').hide(); $(this).parent().next('div.xans-product-listmore').hide(); }, function() { $(this).css('background-image', 'url("//img.echosting.cafe24.com/skin/mobile_ko_KR/layout/bg_title_close.gif")'); $(this).siblings().show(); $(this).parent().find('div.paginate').show(); $(this).parent().next('div.xans-product-listmore').show(); }); /** * 상단탑버튼 */ var globalTopBtnScrollFunc = function() { // 탑버튼 관련변수 var $btnTop = $('#btnTop'); $(window).scroll(function() { try { var iCurScrollPos = $(this).scrollTop(); if (iCurScrollPos > ($(this).height() / 2)) { $btnTop.fadeIn('fast'); } else { $btnTop.fadeOut('fast'); } } catch(e) { } }); }; /** * 구매버튼 */ var globalBuyBtnScrollFunc = function() { // 구매버튼 관련변수 var sFixId = $('#orderFixItem').size() > 0 ? 'orderFixItem' : 'fixedActionButton', $area = $('#orderFixArea'), $item = $('#' + sFixId + '').not($area); $(window).scroll(function(){ try { // 구매버튼 관련변수 var iCurrentHeightPos = $(this).scrollTop() + $(this).height(), iButtonHeightPos = $item.offset().top; if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) { if (iButtonHeightPos < $(this).scrollTop() - $item.height()) { $area.fadeIn('fast'); } else { $area.hide(); } } else { $area.fadeIn('fast'); } } catch(e) { } }); }; globalTopBtnScrollFunc(); globalBuyBtnScrollFunc(); }); // 공통레이어팝업 오픈 var globalLayerOpenFunc = function(_this) { this.id = $(_this).data('id'); this.param = $(_this).data('param'); this.basketType = $('#basket_type').val(); this.url = $(_this).data('url'); this.layerId = 'ec_temp_mobile_layer'; this.layerIframeId = 'ec_temp_mobile_iframe_layer'; var _this = this; function paramSetUrl() { if (this.param) { // if isset param } else { this.url = this.basketType ? this.url + '?basket_type=' + this.basketType : this.url; } }; if (this.url) { window.ecScrollTop = $(window).scrollTop(); $.ajax({ url : this.url, success : function (data) { if (data.indexOf('404 페이지 없음') == -1) { // 있다면 삭제 try { $(_this).remove(); } catch ( e ) { } var $layer = $('
', { html: $("