// placeholder
$(function() {
function loginPlaceholder(){
if ($('.xans-member-login').val() != undefined) {
var loginId = $('#member_id').parent().attr('title');
$('#member_id').attr('placeholder', loginId);
$('#member_passwd').attr('placeholder', 'Password');
}
}
loginPlaceholder();
});
// keyboard
$('.keyboard button').on('click', function(){
if($(this).hasClass('selected')==true){
$('.keyboard .btnKey').removeClass('selected');
$('.view div').hide();
}
else{
$('.keyboard .btnKey').removeClass('selected');
$('.view div').hide();
$(this).addClass('selected');
var key=$(this).attr('title');
$(this).parent().next().children('.'+key+'').show();
}
});
// toggle
$('.ec-base-tab').each(function(){
var selected = $(this).find('> ul > li.selected > a');
});
$('body').on('click', '.ec-base-tab a', function(e){
var _target = $(this).attr('href');
if (_target == '#member') {
$('#member_login_module_id').show();
$('#order_history_nologin_id').hide();
} else {
$('#member_login_module_id').hide();
$('#order_history_nologin_id').show();
}
e.preventDefault();
});
(function () {
if ( typeof window.CustomEvent === "function" ) return false;
function CustomEvent ( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'CustomEvent' );
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
return evt;
}
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
})();
/*
* @preserve dataset polyfill for IE < 11. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset and http://caniuse.com/#search=dataset
*
* @author ShirtlessKirk copyright 2015
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
/*global define: false, module: false */
/*jslint nomen: true, regexp: true, unparam: true */
(function dataset(global) {
var
attribute,
attributes,
counter,
dash,
dataRegEx,
document = global.document,
hasEventListener,
length,
match,
mutationSupport,
test = document.createElement('_'),
DOMAttrModified = 'DOMAttrModified';
function clearDataset(event) {
delete event.target._datasetCache;
}
function toCamelCase(string) {
return string.replace(dash, function (m, letter) {
return letter.toUpperCase();
});
}
function getDataset() {
var
dataset = {};
attributes = this.attributes;
for (counter = 0, length = attributes.length; counter < length; counter += 1) {
attribute = attributes[counter];
match = attribute.name.match(dataRegEx);
if (match) {
dataset[toCamelCase(match[1])] = attribute.value;
}
}
return dataset;
}
function mutation() {
if (hasEventListener) {
test.removeEventListener(DOMAttrModified, mutation, false);
} else {
test.detachEvent('on' + DOMAttrModified, mutation);
}
mutationSupport = true;
}
if (test.dataset !== undefined) {
return;
}
dash = /\-([a-z])/ig;
dataRegEx = /^data\-(.+)/;
hasEventListener = !!document.addEventListener;
mutationSupport = false;
if (hasEventListener) {
test.addEventListener(DOMAttrModified, mutation, false);
} else {
test.attachEvent('on' + DOMAttrModified, mutation);
}
// trigger event (if supported)
test.setAttribute('foo', 'bar');
Object.defineProperty(global.Element.prototype, 'dataset', {
get: mutationSupport
? function get() {
if (!this._datasetCache) {
this._datasetCache = getDataset.call(this);
}
return this._datasetCache;
} : getDataset
});
if (mutationSupport && hasEventListener) { // < IE9 supports neither
document.addEventListener(DOMAttrModified, clearDataset, false);
}
})(window);
// @refer: https://gist.github.com/k-gun/c2ea7c49edf7b757fe9561ba37cb19ca
(function classList() {
// helpers
var regExp = function(name) {
return new RegExp('(^| )'+ name +'( |$)');
};
var forEach = function(list, fn, scope) {
for (var i = 0; i < list.length; i++) {
fn.call(scope, list[i]);
}
};
// class list object with basic methods
function ClassList(element) {
this.element = element;
}
ClassList.prototype = {
add: function() {
forEach(arguments, function(name) {
if (!this.contains(name)) {
this.element.className += this.element.className.length > 0 ? ' ' + name : name;
}
}, this);
},
remove: function() {
forEach(arguments, function(name) {
this.element.className =
this.element.className.replace(regExp(name), '');
}, this);
},
toggle: function(name) {
return this.contains(name)
? (this.remove(name), false) : (this.add(name), true);
},
contains: function(name) {
return regExp(name).test(this.element.className);
},
// bonus..
replace: function(oldName, newName) {
this.remove(oldName), this.add(newName);
}
};
// IE8/9, Safari
if (!('classList' in Element.prototype)) {
Object.defineProperty(Element.prototype, 'classList', {
get: function() {
return new ClassList(this);
}
});
}
// replace() support for others
if (window.DOMTokenList && DOMTokenList.prototype.replace == null) {
DOMTokenList.prototype.replace = ClassList.prototype.replace;
}
})();
if (typeof Object.assign != 'function') {
// Must be writable: true, enumerable: false, configurable: true
Object.defineProperty(Object, "assign", {
value: function assign(target, varArgs) { // .length of function is 2
'use strict';
if (target == null) { // TypeError if undefined or null
throw new TypeError('Cannot convert undefined or null to object');
}
var to = Object(target);
for (var index = 1; index < arguments.length; index++) {
var nextSource = arguments[index];
if (nextSource != null) { // Skip over if undefined or null
for (var nextKey in nextSource) {
// Avoid bugs when hasOwnProperty is shadowed
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey];
}
}
}
}
return to;
},
writable: true,
configurable: true
});
}
(function($) {
var exports = undefined;
/* == malihu jquery custom scrollbar plugin == Version: 3.1.5, License: MIT License (MIT) */
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",i="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";o||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),n&&i.callbacks.onCreate&&"function"==typeof i.callbacks.onCreate&&i.callbacks.onCreate.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=e("#mCSB_"+n.idx),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&Q(t),o&&n&&i.callbacks.onBeforeUpdate&&"function"==typeof i.callbacks.onBeforeUpdate&&i.callbacks.onBeforeUpdate.call(this),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),l.css("max-height","none"),l.height()!==t.height()&&l.css("max-height",t.height()),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r)),n.overflowed=y.call(this),M.call(this),i.autoDraggerLength&&S.call(this),b.call(this),T.call(this);var c=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?B.call(this):(G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(B.call(this),"y"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[1]&&G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?B.call(this):(G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(B.call(this),"x"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[0]&&G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),N.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=Y.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=X.call(this,c[0],"y"),c[1]=X.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=ne()?0:d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",G(n,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",G(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&Q(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);if(o.data(a)){o.data(a);N.call(this,"remove"),k.call(this),t&&B.call(this),M.call(this,!0),o.addClass(d[3])}})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),N.call(this,"remove"),k.call(this),B.call(this),n.removeData(a),$(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],n=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,o)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),$(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["
",""],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p)),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){var o=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],a=t.parent().width();return o[0]>a?o[0]:o[1]>a?o[1]:"100%"},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");if(n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis){i.css({width:"auto","min-width":0,"overflow-x":"scroll"});var r=Math.ceil(i[0].scrollWidth);3===n.advanced.autoExpandHorizontalScroll||2!==n.advanced.autoExpandHorizontalScroll&&r>i.parent().width()?i.css({width:r,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=oe(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["","","",""],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]r&&(r=s),c>l&&(l=c),[r>n.height(),l>n.width()]},B=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(Q(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),G(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),G(t,"_resetX")}},T=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),W.call(o[0])):t()},100)}var o=e(this),n=o.data(a),i=n.opt;if(!n.bindEvents){if(I.call(this),i.contentTouchScroll&&D.call(this),E.call(this),i.mouseWheel.enable){var r;t()}P.call(this),U.call(this),i.advanced.autoScrollOnFocus&&H.call(this),i.scrollButtons.enable&&F.call(this),i.keyboard.enable&&q.call(this),n.bindEvents=!0}},k=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),n.advanced.extraDraggableSelectors&&l.add(e(n.advanced.extraDraggableSelectors)),o.bindEvents&&(e(document).add(e(!A()||top.document)).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),$(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),$(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),$(s[0],"onCompleteTimeout"),o.bindEvents=!1)},M=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},O=function(t){var o=t.type,a=t.target.ownerDocument!==document&&null!==frameElement?[e(frameElement).offset().top,e(frameElement).offset().left]:null,n=A()&&t.target.ownerDocument!==top.document&&null!==frameElement?[e(t.view.frameElement).offset().top,e(t.view.frameElement).offset().left]:[0,0];switch(o){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return a?[t.originalEvent.pageY-a[0]+n[0],t.originalEvent.pageX-a[1]+n[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],r=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[i.screenY,i.screenX,r>1]:[i.pageY,i.pageX,r>1];default:return a?[t.pageY-a[0]+n[0],t.pageX-a[1]+n[1],!1]:[t.pageY,t.pageX,!1]}},I=function(){function t(e,t,a,n){if(h[0].idleTimer=d.scrollInertia<233?250:0,o.attr("id")===f[1])var i="x",s=(o[0].offsetLeft-t+n)*l.scrollRatio.x;else var i="y",s=(o[0].offsetTop-e+a)*l.scrollRatio.y;G(r,s.toString(),{dir:i,drag:!0})}var o,n,i,r=e(this),l=r.data(a),d=l.opt,u=a+"_"+l.idx,f=["mCSB_"+l.idx+"_dragger_vertical","mCSB_"+l.idx+"_dragger_horizontal"],h=e("#mCSB_"+l.idx+"_container"),m=e("#"+f[0]+",#"+f[1]),p=d.advanced.releaseDraggableSelectors?m.add(e(d.advanced.releaseDraggableSelectors)):m,g=d.advanced.extraDraggableSelectors?e(!A()||top.document).add(e(d.advanced.extraDraggableSelectors)):e(!A()||top.document);m.bind("contextmenu."+u,function(e){e.preventDefault()}).bind("mousedown."+u+" touchstart."+u+" pointerdown."+u+" MSPointerDown."+u,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),ee(t)){c=!0,s&&(document.onselectstart=function(){return!1}),L.call(h,!1),Q(r),o=e(this);var a=o.offset(),l=O(t)[0]-a.top,u=O(t)[1]-a.left,f=o.height()+a.top,m=o.width()+a.left;f>l&&l>0&&m>u&&u>0&&(n=l,i=u),C(o,"active",d.autoExpandScrollbar)}}).bind("touchmove."+u,function(e){e.stopImmediatePropagation(),e.preventDefault();var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;t(n,i,r,l)}),e(document).add(g).bind("mousemove."+u+" pointermove."+u+" MSPointerMove."+u,function(e){if(o){var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;if(n===r&&i===l)return;t(n,i,r,l)}}).add(p).bind("mouseup."+u+" touchend."+u+" pointerup."+u+" MSPointerUp."+u,function(){o&&(C(o,"active",d.autoExpandScrollbar),o=null),c=!1,s&&(document.onselectstart=null),L.call(h,!0)})},D=function(){function o(e){if(!te(e)||c||O(e)[2])return void(t=0);t=1,b=0,C=0,d=1,y.removeClass("mCS_touch_action");var o=I.offset();u=O(e)[0]-o.top,f=O(e)[1]-o.left,z=[O(e)[0],O(e)[1]]}function n(e){if(te(e)&&!c&&!O(e)[2]&&(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!C||b)&&d)){g=K();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left,n="mcsLinearOut";if(E.push(o),W.push(a),z[2]=Math.abs(O(e)[0]-z[0]),z[3]=Math.abs(O(e)[1]-z[1]),B.overflowed[0])var i=D[0].parent().height()-D[0].height(),r=u-o>0&&o-u>-(i*B.scrollRatio.y)&&(2*z[3]0&&a-f>-(l*B.scrollRatio.x)&&(2*z[2]30)){_=1e3/(v-p);var n="mcsEaseOut",i=2.5>_,r=i?[E[E.length-2],W[W.length-2]]:[0,0];x=i?[o-r[0],a-r[1]]:[o-h,a-m];var u=[Math.abs(x[0]),Math.abs(x[1])];_=i?[Math.abs(x[0]/4),Math.abs(x[1]/4)]:[_,_];var f=[Math.abs(I[0].offsetTop)-x[0]*l(u[0]/_[0],_[0]),Math.abs(I[0].offsetLeft)-x[1]*l(u[1]/_[1],_[1])];w="yx"===T.axis?[f[0],f[1]]:"x"===T.axis?[null,f[1]]:[f[0],null],S=[4*u[0]+T.scrollInertia,4*u[1]+T.scrollInertia];var y=parseInt(T.contentTouchScroll)||0;w[0]=u[0]>y?w[0]:0,w[1]=u[1]>y?w[1]:0,B.overflowed[0]&&s(w[0],S[0],n,"y",L,!1),B.overflowed[1]&&s(w[1],S[1],n,"x",L,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&G(y,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C,y=e(this),B=y.data(a),T=B.opt,k=a+"_"+B.idx,M=e("#mCSB_"+B.idx),I=e("#mCSB_"+B.idx+"_container"),D=[e("#mCSB_"+B.idx+"_dragger_vertical"),e("#mCSB_"+B.idx+"_dragger_horizontal")],E=[],W=[],R=0,L="yx"===T.axis?"none":"all",z=[],P=I.find("iframe"),H=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k],U=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;I.bind(H[0],function(e){o(e)}).bind(H[1],function(e){n(e)}),M.bind(H[0],function(e){i(e)}).bind(H[2],function(e){r(e)}),P.length&&P.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(H[0],function(e){o(e),i(e)}).bind(H[1],function(e){n(e)}).bind(H[2],function(e){r(e)})})})},E=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,j(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(a),s=l.opt,d=l.sequential,u=a+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var a=f.offset(),r=O(e)[0]-a.top+f[0].offsetTop,c=O(e)[1]-a.left+f[0].offsetLeft;r>0&&r0&&cr?n("on",38):r>h.height()&&n("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?n("on",37):c>h.width()&&n("on",39)))}}).bind("mouseup."+u+" dragend."+u,function(){t||(i&&(i=0,n("off",null)),c=!1)})},W=function(){function t(t,a){if(Q(o),!z(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100,d=i.scrollInertia;if("x"===i.axis||"x"===i.mouseWheel.axis)var u="x",f=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.width()?.9*l.width():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),p=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v="y"===i.mouseWheel.axis?t.deltaY||a:t.deltaX;else var u="y",f=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.height()?.9*l.height():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),p=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=t.deltaY||a;"y"===u&&!n.overflowed[0]||"x"===u&&!n.overflowed[1]||((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(v=-v),i.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==p||0>v&&p!==g||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<5&&!i.mouseWheel.normalizeDelta&&(h=t.deltaFactor,d=17),G(o,(m-v*h).toString(),{dir:u,dur:d}))}}if(e(this).data(a)){var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");d.length&&d.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)})}},R=new Object,A=function(t){var o=!1,a=!1,n=null;if(void 0===t?a="#empty":void 0!==e(t).attr("id")&&(a=e(t).attr("id")),a!==!1&&void 0!==R[a])return R[a];if(t){try{var i=t.contentDocument||t.contentWindow.document;n=i.body.innerHTML}catch(r){}o=null!==n}else{try{var i=top.document;n=i.body.innerHTML}catch(r){}o=null!==n}return a!==!1&&(R[a]=o),o},L=function(e){var t=this.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}},z=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(n,i)>-1&&!(e.inArray(n,r)>-1&&!e(o).is(":focus"))},P=function(){var t,o=e(this),n=o.data(a),i=a+"_"+n.idx,r=e("#mCSB_"+n.idx+"_container"),l=r.parent(),s=e(".mCSB_"+n.idx+"_scrollbar ."+d[12]);s.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i,function(o){c=!0,e(o.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+i+" pointerup."+i+" MSPointerUp."+i,function(){c=!1}).bind("click."+i,function(a){if(t&&(t=0,e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail"))){Q(o);var i=e(this),s=i.find(".mCSB_dragger");if(i.parent(".mCSB_scrollTools_horizontal").length>0){if(!n.overflowed[1])return;var c="x",u=a.pageX>s.offset().left?-1:1,f=Math.abs(r[0].offsetLeft)-u*(.9*l.width())}else{if(!n.overflowed[0])return;var c="y",u=a.pageY>s.offset().top?-1:1,f=Math.abs(r[0].offsetTop)-u*(.9*l.height())}G(o,f.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},H=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(){var o=e(document.activeElement),a=r.find(".mCustomScrollBox").length,i=0;o.is(n.advanced.autoScrollOnFocus)&&(Q(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=a?(i+17)*a:0,t[0]._focusTimeout=setTimeout(function(){var e=[ae(o)[0],ae(o)[1]],a=[r[0].offsetTop,r[0].offsetLeft],s=[a[0]+e[0]>=0&&a[0]+e[0]=0&&a[0]+e[1]a");s.bind("contextmenu."+r,function(e){e.preventDefault()}).bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.scrollButtons.scrollAmount,j(t,e,o)}if(a.preventDefault(),ee(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},q=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||j(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){Q(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-f*(.9*d.width());else var h="y",m=Math.abs(c[0].offsetTop)-f*(.9*d.height());G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},j=function(t,o,n,i,r){function l(e){u.snapAmount&&(f.scrollAmount=u.snapAmount instanceof Array?"x"===f.dir[0]?u.snapAmount[1]:u.snapAmount[0]:u.snapAmount);var o="stepped"!==f.type,a=r?r:e?o?p/1.5:g:1e3/60,n=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],m="x"===f.dir[0]?s[1]+f.dir[1]*(d[1]*n):s[0]+f.dir[1]*(d[0]*n),v="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),x="auto"!==f.scrollAmount?v:m,_=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",w=!!e;return e&&17>a&&(x="x"===f.dir[0]?s[1]:s[0]),G(t,x.toString(),{dir:f.dir[0],scrollEasing:_,dur:a,onComplete:w}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},a)))}function s(){clearTimeout(f.step),$(f,"step"),Q(t)}var c=t.data(a),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],Q(t),oe(n)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},Y=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},X=function(t,o){if(null!=t&&"undefined"!=typeof t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1)-s.width():l.outerHeight(!1)-s.height(),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?ae(m)[1]:ae(m)[0];case"string":case"number":if(oe(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&oe(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?ae(m)[1]:ae(m)[0]}return e(t).length?"x"===o?ae(e(t))[1]:ae(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},N=function(t){function o(){return clearTimeout(f[0].autoUpdate),0===l.parents("html").length?void(l=null):void(f[0].autoUpdate=setTimeout(function(){return c.advanced.updateOnSelectorChange&&(s.poll.change.n=i(),s.poll.change.n!==s.poll.change.o)?(s.poll.change.o=s.poll.change.n,void r(3)):c.advanced.updateOnContentResize&&(s.poll.size.n=l[0].scrollHeight+l[0].scrollWidth+f[0].offsetHeight+l[0].offsetHeight+l[0].offsetWidth,s.poll.size.n!==s.poll.size.o)?(s.poll.size.o=s.poll.size.n,void r(1)):!c.advanced.updateOnImageLoad||"auto"===c.advanced.updateOnImageLoad&&"y"===c.axis||(s.poll.img.n=f.find("img").length,s.poll.img.n===s.poll.img.o)?void((c.advanced.updateOnSelectorChange||c.advanced.updateOnContentResize||c.advanced.updateOnImageLoad)&&o()):(s.poll.img.o=s.poll.img.n,void f.find("img").each(function(){n(this)}))},c.advanced.autoUpdateTimeout))}function n(t){function o(e,t){return function(){
return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(d[2]),r(2)}if(e(t).hasClass(d[2]))return void r();var n=new Image;n.onload=o(n,a),n.src=t.src}function i(){c.advanced.updateOnSelectorChange===!0&&(c.advanced.updateOnSelectorChange="*");var e=0,t=f.find(c.advanced.updateOnSelectorChange);return c.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}function r(e){clearTimeout(f[0].autoUpdate),u.update.call(null,l[0],e)}var l=e(this),s=l.data(a),c=s.opt,f=e("#mCSB_"+s.idx+"_container");return t?(clearTimeout(f[0].autoUpdate),void $(f[0],"autoUpdate")):void o()},V=function(e,t,o){return Math.round(e/t)*t-o},Q=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){Z.call(this)})},G=function(t,o,n){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||w>=S[0]+y,c.callbacks.alwaysTriggerOffsets||-B>=w]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[x[0].offsetTop,x[0].offsetLeft],a=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var s=t.data(a),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(d,n),u=[n.dur,n.drag?0:n.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?Y.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?Y.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=n.trigger,0===m.scrollTop()&&0===m.scrollLeft()||(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){if(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount){var v=c.snapAmount instanceof Array?"x"===n.dir?c.snapAmount[1]:c.snapAmount[0]:c.snapAmount;o=V(o,v,c.snapOffset)}switch(n.dir){case"x":var x=e("#mCSB_"+s.idx+"_dragger_horizontal"),_="left",w=h[0].offsetLeft,S=[f.width()-h.outerWidth(!1),x.parent().width()-x.width()],b=[o,0===o?0:o/s.scrollRatio.x],y=p[1],B=g[1],T=y>0?y/s.scrollRatio.x:0,k=B>0?B/s.scrollRatio.x:0;break;case"y":var x=e("#mCSB_"+s.idx+"_dragger_vertical"),_="top",w=h[0].offsetTop,S=[f.height()-h.outerHeight(!1),x.parent().height()-x.height()],b=[o,0===o?0:o/s.scrollRatio.y],y=p[0],B=g[0],T=y>0?y/s.scrollRatio.y:0,k=B>0?B/s.scrollRatio.y:0}b[1]<0||0===b[0]&&0===b[1]?b=[0,0]:b[1]>=S[1]?b=[S[0],S[1]]:b[0]=-b[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),J(x[0],_,Math.round(b[1]),u[1],n.scrollEasing),!s.tweenRunning&&(0===w&&b[0]>=0||w===S[0]&&b[0]<=S[0])||J(h[0],_,Math.round(b[0]),u[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,C(x),s.cbOffsets=r())},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&b[1]>=S[1]-T&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&b[1]<=k&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,C(x,"hide")},e)}}})}},J=function(e,t,o,a,n,i,r){function l(){S.stop||(x||m.call(),x=K()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time0?(S.currVal=u(S.time,_,b,a,n),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=a/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=K(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},K=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},Z=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o=0&&a[0]+ae(n)[0]=0&&a[1]+ae(n)[1]=0&&r[1]-i[1]*l[1][0]<0&&r[1]+n[1]-i[1]*l[1][1]>=0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var o=e(t).data(a);if(o)return o.overflowed[0]||o.overflowed[1]}})})})});
/**
* Swiper 4.5.0
* Most modern mobile touch slider and framework with hardware accelerated transitions
* http://www.idangero.us/swiper/
*
* Copyright 2014-2019 Vladimir Kharlampidi
*
* Released under the MIT License
*
* Released on: February 22, 2019
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Swiper=t()}(this,function(){"use strict";var f="undefined"==typeof document?{body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},location:{hash:""}}:document,J="undefined"==typeof window?{document:f,navigator:{userAgent:""},location:{},history:{},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){}}:window,l=function(e){for(var t=0;t")){var o="div";for(0===n.indexOf(":~]/)?(t||f).querySelectorAll(e.trim()):[f.getElementById(e.trim().split("#")[1])],i=0;ia.slides.length)break;i.push(a.slides.eq(r)[0])}else i.push(a.slides.eq(a.activeIndex)[0]);for(t=0;t=t.size)&&(t.visibleSlides.push(o),t.visibleSlidesIndexes.push(n),i.eq(n).addClass(a.slideVisibleClass))}o.progress=s?-l:l}t.visibleSlides=L(t.visibleSlides)}},updateProgress:function(e){void 0===e&&(e=this&&this.translate||0);var t=this,a=t.params,i=t.maxTranslate()-t.minTranslate(),s=t.progress,r=t.isBeginning,n=t.isEnd,o=r,l=n;0===i?n=r=!(s=0):(r=(s=(e-t.minTranslate())/i)<=0,n=1<=s),ee.extend(t,{progress:s,isBeginning:r,isEnd:n}),(a.watchSlidesProgress||a.watchSlidesVisibility)&&t.updateSlidesProgress(e),r&&!o&&t.emit("reachBeginning toEdge"),n&&!l&&t.emit("reachEnd toEdge"),(o&&!r||l&&!n)&&t.emit("fromEdge"),t.emit("progress",s)},updateSlidesClasses:function(){var e,t=this,a=t.slides,i=t.params,s=t.$wrapperEl,r=t.activeIndex,n=t.realIndex,o=t.virtual&&i.virtual.enabled;a.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(e=o?t.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+r+'"]'):a.eq(r)).addClass(i.slideActiveClass),i.loop&&(e.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+n+'"]').addClass(i.slideDuplicateActiveClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+n+'"]').addClass(i.slideDuplicateActiveClass));var l=e.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===l.length&&(l=a.eq(0)).addClass(i.slideNextClass);var d=e.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===d.length&&(d=a.eq(-1)).addClass(i.slidePrevClass),i.loop&&(l.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),d.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+d.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+d.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass))},updateActiveIndex:function(e){var t,a=this,i=a.rtlTranslate?a.translate:-a.translate,s=a.slidesGrid,r=a.snapGrid,n=a.params,o=a.activeIndex,l=a.realIndex,d=a.snapIndex,p=e;if(void 0===p){for(var c=0;c=s[c]&&i=s[c]&&i=s[c]&&(p=c);n.normalizeSlideIndex&&(p<0||void 0===p)&&(p=0)}if((t=0<=r.indexOf(i)?r.indexOf(i):Math.floor(p/n.slidesPerGroup))>=r.length&&(t=r.length-1),p!==o){var u=parseInt(a.slides.eq(p).attr("data-swiper-slide-index")||p,10);ee.extend(a,{snapIndex:t,realIndex:u,previousIndex:o,activeIndex:p}),a.emit("activeIndexChange"),a.emit("snapIndexChange"),l!==u&&a.emit("realIndexChange"),a.emit("slideChange")}else t!==d&&(a.snapIndex=t,a.emit("snapIndexChange"))},updateClickedSlide:function(e){var t=this,a=t.params,i=L(e.target).closest("."+a.slideClass)[0],s=!1;if(i)for(var r=0;r=o.length&&(u=o.length-1),(p||n.initialSlide||0)===(d||0)&&a&&s.emit("beforeSlideChangeStart");var h,v=-o[u];if(s.updateProgress(v),n.normalizeSlideIndex)for(var f=0;f=Math.floor(100*l[f])&&(r=f);if(s.initialized&&r!==p){if(!s.allowSlideNext&&vs.translate&&v>s.maxTranslate()&&(p||0)!==r)return!1}return h=pt.slides.length-t.loopedSlides+s/2?(t.loopFix(),r=i.children("."+a.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+a.slideDuplicateClass+")").eq(0).index(),ee.nextTick(function(){t.slideTo(r)})):t.slideTo(r):r>t.slides.length-s?(t.loopFix(),r=i.children("."+a.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+a.slideDuplicateClass+")").eq(0).index(),ee.nextTick(function(){t.slideTo(r)})):t.slideTo(r)}else t.slideTo(r)}};var h={loopCreate:function(){var i=this,e=i.params,t=i.$wrapperEl;t.children("."+e.slideClass+"."+e.slideDuplicateClass).remove();var s=t.children("."+e.slideClass);if(e.loopFillGroupWithBlank){var a=e.slidesPerGroup-s.length%e.slidesPerGroup;if(a!==e.slidesPerGroup){for(var r=0;rs.length&&(i.loopedSlides=s.length);var o=[],l=[];s.each(function(e,t){var a=L(t);e=s.length-i.loopedSlides&&o.push(t),a.attr("data-swiper-slide-index",e)});for(var d=0;d=s.length-r)&&(e=-s.length+i+r,e+=r,t.slideTo(e,0,!1,!0)&&0!==p&&t.setTranslate((d?-t.translate:t.translate)-p));t.allowSlidePrev=n,t.allowSlideNext=o},loopDestroy:function(){var e=this.$wrapperEl,t=this.params,a=this.slides;e.children("."+t.slideClass+"."+t.slideDuplicateClass+",."+t.slideClass+"."+t.slideBlankClass).remove(),a.removeAttr("data-swiper-slide-index")}};var v={setGrabCursor:function(e){if(!(te.touch||!this.params.simulateTouch||this.params.watchOverflow&&this.isLocked)){var t=this.el;t.style.cursor="move",t.style.cursor=e?"-webkit-grabbing":"-webkit-grab",t.style.cursor=e?"-moz-grabbin":"-moz-grab",t.style.cursor=e?"grabbing":"grab"}},unsetGrabCursor:function(){te.touch||this.params.watchOverflow&&this.isLocked||(this.el.style.cursor="")}};var m={appendSlide:function(e){var t=this,a=t.$wrapperEl,i=t.params;if(i.loop&&t.loopDestroy(),"object"==typeof e&&"length"in e)for(var s=0;s=J.screen.width-d)){if(ee.extend(a,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),s.startX=n,s.startY=o,a.touchStartTime=ee.now(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,0s.startY&&t.translate>=t.minTranslate())return a.isTouched=!1,void(a.isMoved=!1)}else if(os.startX&&t.translate>=t.minTranslate())return;if(a.isTouchEvent&&f.activeElement&&n.target===f.activeElement&&L(n.target).is(a.formElements))return a.isMoved=!0,void(t.allowClick=!1);if(a.allowTouchCallbacks&&t.emit("touchMove",n),!(n.targetTouches&&1i.touchAngle:90-d>i.touchAngle)),a.isScrolling&&t.emit("touchMoveOpposite",n),void 0===a.startMoving&&(s.currentX===s.startX&&s.currentY===s.startY||(a.startMoving=!0)),a.isScrolling)a.isTouched=!1;else if(a.startMoving){t.allowClick=!1,n.preventDefault(),i.touchMoveStopPropagation&&!i.nested&&n.stopPropagation(),a.isMoved||(i.loop&&t.loopFix(),a.startTranslate=t.getTranslate(),t.setTransition(0),t.animating&&t.$wrapperEl.trigger("webkitTransitionEnd transitionend"),a.allowMomentumBounce=!1,!i.grabCursor||!0!==t.allowSlideNext&&!0!==t.allowSlidePrev||t.setGrabCursor(!0),t.emit("sliderFirstMove",n)),t.emit("sliderMove",n),a.isMoved=!0;var u=t.isHorizontal()?p:c;s.diff=u,u*=i.touchRatio,r&&(u=-u),t.swipeDirection=0t.minTranslate()?(h=!1,i.resistance&&(a.currentTranslate=t.minTranslate()-1+Math.pow(-t.minTranslate()+a.startTranslate+u,v))):u<0&&a.currentTranslatea.startTranslate&&(a.currentTranslate=a.startTranslate),0i.threshold||a.allowThresholdMove))return void(a.currentTranslate=a.startTranslate);if(!a.allowThresholdMove)return a.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,a.currentTranslate=a.startTranslate,void(s.diff=t.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}i.followFinger&&((i.freeMode||i.watchSlidesProgress||i.watchSlidesVisibility)&&(t.updateActiveIndex(),t.updateSlidesClasses()),i.freeMode&&(0===a.velocities.length&&a.velocities.push({position:s[t.isHorizontal()?"startX":"startY"],time:a.touchStartTime}),a.velocities.push({position:s[t.isHorizontal()?"currentX":"currentY"],time:ee.now()})),t.updateProgress(a.currentTranslate),t.setTranslate(a.currentTranslate))}}}}else a.startMoving&&a.isScrolling&&t.emit("touchMoveOpposite",n)}.bind(e),e.onTouchEnd=function(e){var t=this,a=t.touchEventsData,i=t.params,s=t.touches,r=t.rtlTranslate,n=t.$wrapperEl,o=t.slidesGrid,l=t.snapGrid,d=e;if(d.originalEvent&&(d=d.originalEvent),a.allowTouchCallbacks&&t.emit("touchEnd",d),a.allowTouchCallbacks=!1,!a.isTouched)return a.isMoved&&i.grabCursor&&t.setGrabCursor(!1),a.isMoved=!1,void(a.startMoving=!1);i.grabCursor&&a.isMoved&&a.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);var p,c=ee.now(),u=c-a.touchStartTime;if(t.allowClick&&(t.updateClickedSlide(d),t.emit("tap",d),u<300&&300-t.maxTranslate())return void(t.slides.lengtht.minTranslate())i.freeModeMomentumBounce?(w-t.minTranslate()>E&&(w=t.minTranslate()+E),y=t.minTranslate(),T=!0,a.allowMomentumBounce=!0):w=t.minTranslate(),i.loop&&i.centeredSlides&&(x=!0);else if(i.freeModeSticky){for(var S,C=0;C-w){S=C;break}w=-(w=Math.abs(l[S]-w)=i.longSwipesMs)&&(t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}else{for(var M=0,z=t.slidesSizesGrid[0],P=0;P=o[P]&&p=o[P]&&(M=P,z=o[o.length-1]-o[o.length-2]);var k=(p-o[M])/z;if(u>i.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(k>=i.longSwipesRatio?t.slideTo(M+i.slidesPerGroup):t.slideTo(M)),"prev"===t.swipeDirection&&(k>1-i.longSwipesRatio?t.slideTo(M+i.slidesPerGroup):t.slideTo(M))}else{if(!i.shortSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&t.slideTo(M+i.slidesPerGroup),"prev"===t.swipeDirection&&t.slideTo(M)}}}.bind(e),e.onClick=function(e){this.allowClick||(this.params.preventClicks&&e.preventDefault(),this.params.preventClicksPropagation&&this.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))}.bind(e);var r="container"===t.touchEventsTarget?i:s,n=!!t.nested;if(te.touch||!te.pointerEvents&&!te.prefixedPointerEvents){if(te.touch){var o=!("touchstart"!==a.start||!te.passiveListener||!t.passiveListeners)&&{passive:!0,capture:!1};r.addEventListener(a.start,e.onTouchStart,o),r.addEventListener(a.move,e.onTouchMove,te.passiveListener?{passive:!1,capture:n}:n),r.addEventListener(a.end,e.onTouchEnd,o)}(t.simulateTouch&&!g.ios&&!g.android||t.simulateTouch&&!te.touch&&g.ios)&&(r.addEventListener("mousedown",e.onTouchStart,!1),f.addEventListener("mousemove",e.onTouchMove,n),f.addEventListener("mouseup",e.onTouchEnd,!1))}else r.addEventListener(a.start,e.onTouchStart,!1),f.addEventListener(a.move,e.onTouchMove,n),f.addEventListener(a.end,e.onTouchEnd,!1);(t.preventClicks||t.preventClicksPropagation)&&r.addEventListener("click",e.onClick,!0),e.on(g.ios||g.android?"resize orientationchange observerUpdate":"resize observerUpdate",b,!0)},detachEvents:function(){var e=this,t=e.params,a=e.touchEvents,i=e.el,s=e.wrapperEl,r="container"===t.touchEventsTarget?i:s,n=!!t.nested;if(te.touch||!te.pointerEvents&&!te.prefixedPointerEvents){if(te.touch){var o=!("onTouchStart"!==a.start||!te.passiveListener||!t.passiveListeners)&&{passive:!0,capture:!1};r.removeEventListener(a.start,e.onTouchStart,o),r.removeEventListener(a.move,e.onTouchMove,n),r.removeEventListener(a.end,e.onTouchEnd,o)}(t.simulateTouch&&!g.ios&&!g.android||t.simulateTouch&&!te.touch&&g.ios)&&(r.removeEventListener("mousedown",e.onTouchStart,!1),f.removeEventListener("mousemove",e.onTouchMove,n),f.removeEventListener("mouseup",e.onTouchEnd,!1))}else r.removeEventListener(a.start,e.onTouchStart,!1),f.removeEventListener(a.move,e.onTouchMove,n),f.removeEventListener(a.end,e.onTouchEnd,!1);(t.preventClicks||t.preventClicksPropagation)&&r.removeEventListener("click",e.onClick,!0),e.off(g.ios||g.android?"resize orientationchange observerUpdate":"resize observerUpdate",b)}},breakpoints:{setBreakpoint:function(){var e=this,t=e.activeIndex,a=e.initialized,i=e.loopedSlides;void 0===i&&(i=0);var s=e.params,r=s.breakpoints;if(r&&(!r||0!==Object.keys(r).length)){var n=e.getBreakpoint(r);if(n&&e.currentBreakpoint!==n){var o=n in r?r[n]:void 0;o&&["slidesPerView","spaceBetween","slidesPerGroup"].forEach(function(e){var t=o[e];void 0!==t&&(o[e]="slidesPerView"!==e||"AUTO"!==t&&"auto"!==t?"slidesPerView"===e?parseFloat(t):parseInt(t,10):"auto")});var l=o||e.originalParams,d=l.direction&&l.direction!==s.direction,p=s.loop&&(l.slidesPerView!==s.slidesPerView||d);d&&a&&e.changeDirection(),ee.extend(e.params,l),ee.extend(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),e.currentBreakpoint=n,p&&a&&(e.loopDestroy(),e.loopCreate(),e.updateSlides(),e.slideTo(t-i+e.loopedSlides,0,!1)),e.emit("breakpoint",l)}}},getBreakpoint:function(e){if(e){var t=!1,a=[];Object.keys(e).forEach(function(e){a.push(e)}),a.sort(function(e,t){return parseInt(e,10)-parseInt(t,10)});for(var i=0;i=J.innerWidth&&!t&&(t=s)}return t||"max"}}},checkOverflow:{checkOverflow:function(){var e=this,t=e.isLocked;e.isLocked=1===e.snapGrid.length,e.allowSlideNext=!e.isLocked,e.allowSlidePrev=!e.isLocked,t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock"),t&&t!==e.isLocked&&(e.isEnd=!1,e.navigation.update())}},classes:{addClasses:function(){var t=this.classNames,a=this.params,e=this.rtl,i=this.$el,s=[];s.push("initialized"),s.push(a.direction),a.freeMode&&s.push("free-mode"),te.flexbox||s.push("no-flexbox"),a.autoHeight&&s.push("autoheight"),e&&s.push("rtl"),1'+e+"");return s.attr("data-swiper-slide-index")||s.attr("data-swiper-slide-index",t),i.cache&&(a.virtual.cache[t]=s),s},appendSlide:function(e){if("object"==typeof e&&"length"in e)for(var t=0;tMath.abs(n.pixelY)))return!0;s=n.pixelX*r}else{if(!(Math.abs(n.pixelY)>Math.abs(n.pixelX)))return!0;s=n.pixelY}else s=Math.abs(n.pixelX)>Math.abs(n.pixelY)?-n.pixelX*r:-n.pixelY;if(0===s)return!0;if(i.invert&&(s=-s),a.params.freeMode){a.params.loop&&a.loopFix();var o=a.getTranslate()+s*i.sensitivity,l=a.isBeginning,d=a.isEnd;if(o>=a.minTranslate()&&(o=a.minTranslate()),o<=a.maxTranslate()&&(o=a.maxTranslate()),a.setTransition(0),a.setTranslate(o),a.updateProgress(),a.updateActiveIndex(),a.updateSlidesClasses(),(!l&&a.isBeginning||!d&&a.isEnd)&&a.updateSlidesClasses(),a.params.freeModeSticky&&(clearTimeout(a.mousewheel.timeout),a.mousewheel.timeout=ee.nextTick(function(){a.slideToClosest()},300)),a.emit("scroll",t),a.params.autoplay&&a.params.autoplayDisableOnInteraction&&a.autoplay.stop(),o===a.minTranslate()||o===a.maxTranslate())return!0}else{if(60a-1-2*e.loopedSlides&&(r-=a-2*e.loopedSlides),n-1s.dynamicMainBullets-1?e.pagination.dynamicBulletIndex=s.dynamicMainBullets-1:e.pagination.dynamicBulletIndex<0&&(e.pagination.dynamicBulletIndex=0)),o=r-e.pagination.dynamicBulletIndex,d=((l=o+(Math.min(p.length,s.dynamicMainBullets)-1))+o)/2),p.removeClass(s.bulletActiveClass+" "+s.bulletActiveClass+"-next "+s.bulletActiveClass+"-next-next "+s.bulletActiveClass+"-prev "+s.bulletActiveClass+"-prev-prev "+s.bulletActiveClass+"-main"),1'+t.bulletElement+">";i.html(s),e.pagination.bullets=i.find("."+t.bulletClass)}"fraction"===t.type&&(s=t.renderFraction?t.renderFraction.call(e,t.currentClass,t.totalClass):' / ',i.html(s)),"progressbar"===t.type&&(s=t.renderProgressbar?t.renderProgressbar.call(e,t.progressbarFillClass):'',i.html(s)),"custom"!==t.type&&e.emit("paginationRender",e.pagination.$el[0])}},init:function(){var a=this,e=a.params.pagination;if(e.el){var t=L(e.el);0!==t.length&&(a.params.uniqueNavElements&&"string"==typeof e.el&&1'),s.append(r)),ee.extend(t,{$el:s,el:s[0],$dragEl:r,dragEl:r[0]}),i.draggable&&t.enableDraggable()}},destroy:function(){this.scrollbar.disableDraggable()}},B={setTransform:function(e,t){var a=this.rtl,i=L(e),s=a?-1:1,r=i.attr("data-swiper-parallax")||"0",n=i.attr("data-swiper-parallax-x"),o=i.attr("data-swiper-parallax-y"),l=i.attr("data-swiper-parallax-scale"),d=i.attr("data-swiper-parallax-opacity");if(n||o?(n=n||"0",o=o||"0"):this.isHorizontal()?(n=r,o="0"):(o=r,n="0"),n=0<=n.indexOf("%")?parseInt(n,10)*t*s+"%":n*t*s+"px",o=0<=o.indexOf("%")?parseInt(o,10)*t+"%":o*t+"px",null!=d){var p=d-(d-1)*(1-Math.abs(t));i[0].style.opacity=p}if(null==l)i.transform("translate3d("+n+", "+o+", 0px)");else{var c=l-(l-1)*(1-Math.abs(t));i.transform("translate3d("+n+", "+o+", 0px) scale("+c+")")}},setTranslate:function(){var i=this,e=i.$el,t=i.slides,s=i.progress,r=i.snapGrid;e.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(e,t){i.parallax.setTransform(t,s)}),t.each(function(e,t){var a=t.progress;1i.maxRatio&&(a.scale=i.maxRatio-1+Math.pow(a.scale-i.maxRatio+1,.5)),a.scales.touchesStart.x))return void(s.isTouched=!1);if(!t.isHorizontal()&&(Math.floor(s.minY)===Math.floor(s.startY)&&s.touchesCurrent.ys.touchesStart.y))return void(s.isTouched=!1)}e.preventDefault(),e.stopPropagation(),s.isMoved=!0,s.currentX=s.touchesCurrent.x-s.touchesStart.x+s.startX,s.currentY=s.touchesCurrent.y-s.touchesStart.y+s.startY,s.currentXs.maxX&&(s.currentX=s.maxX-1+Math.pow(s.currentX-s.maxX+1,.8)),s.currentYs.maxY&&(s.currentY=s.maxY-1+Math.pow(s.currentY-s.maxY+1,.8)),r.prevPositionX||(r.prevPositionX=s.touchesCurrent.x),r.prevPositionY||(r.prevPositionY=s.touchesCurrent.y),r.prevTime||(r.prevTime=Date.now()),r.x=(s.touchesCurrent.x-r.prevPositionX)/(Date.now()-r.prevTime)/2,r.y=(s.touchesCurrent.y-r.prevPositionY)/(Date.now()-r.prevTime)/2,Math.abs(s.touchesCurrent.x-r.prevPositionX)<2&&(r.x=0),Math.abs(s.touchesCurrent.y-r.prevPositionY)<2&&(r.y=0),r.prevPositionX=s.touchesCurrent.x,r.prevPositionY=s.touchesCurrent.y,r.prevTime=Date.now(),i.$imageWrapEl.transform("translate3d("+s.currentX+"px, "+s.currentY+"px,0)")}}},onTouchEnd:function(){var e=this.zoom,t=e.gesture,a=e.image,i=e.velocity;if(t.$imageEl&&0!==t.$imageEl.length){if(!a.isTouched||!a.isMoved)return a.isTouched=!1,void(a.isMoved=!1);a.isTouched=!1,a.isMoved=!1;var s=300,r=300,n=i.x*s,o=a.currentX+n,l=i.y*r,d=a.currentY+l;0!==i.x&&(s=Math.abs((o-a.currentX)/i.x)),0!==i.y&&(r=Math.abs((d-a.currentY)/i.y));var p=Math.max(s,r);a.currentX=o,a.currentY=d;var c=a.width*e.scale,u=a.height*e.scale;a.minX=Math.min(t.slideWidth/2-c/2,0),a.maxX=-a.minX,a.minY=Math.min(t.slideHeight/2-u/2,0),a.maxY=-a.minY,a.currentX=Math.max(Math.min(a.currentX,a.maxX),a.minX),a.currentY=Math.max(Math.min(a.currentY,a.maxY),a.minY),t.$imageWrapEl.transition(p).transform("translate3d("+a.currentX+"px, "+a.currentY+"px,0)")}},onTransitionEnd:function(){var e=this.zoom,t=e.gesture;t.$slideEl&&this.previousIndex!==this.activeIndex&&(t.$imageEl.transform("translate3d(0,0,0) scale(1)"),t.$imageWrapEl.transform("translate3d(0,0,0)"),e.scale=1,e.currentScale=1,t.$slideEl=void 0,t.$imageEl=void 0,t.$imageWrapEl=void 0)},toggle:function(e){var t=this.zoom;t.scale&&1!==t.scale?t.out():t.in(e)},in:function(e){var t,a,i,s,r,n,o,l,d,p,c,u,h,v,f,m,g=this,b=g.zoom,w=g.params.zoom,y=b.gesture,x=b.image;(y.$slideEl||(y.$slideEl=g.clickedSlide?L(g.clickedSlide):g.slides.eq(g.activeIndex),y.$imageEl=y.$slideEl.find("img, svg, canvas"),y.$imageWrapEl=y.$imageEl.parent("."+w.containerClass)),y.$imageEl&&0!==y.$imageEl.length)&&(y.$slideEl.addClass(""+w.zoomedSlideClass),void 0===x.touchesStart.x&&e?(t="touchend"===e.type?e.changedTouches[0].pageX:e.pageX,a="touchend"===e.type?e.changedTouches[0].pageY:e.pageY):(t=x.touchesStart.x,a=x.touchesStart.y),b.scale=y.$imageWrapEl.attr("data-swiper-zoom")||w.maxRatio,b.currentScale=y.$imageWrapEl.attr("data-swiper-zoom")||w.maxRatio,e?(f=y.$slideEl[0].offsetWidth,m=y.$slideEl[0].offsetHeight,i=y.$slideEl.offset().left+f/2-t,s=y.$slideEl.offset().top+m/2-a,o=y.$imageEl[0].offsetWidth,l=y.$imageEl[0].offsetHeight,d=o*b.scale,p=l*b.scale,h=-(c=Math.min(f/2-d/2,0)),v=-(u=Math.min(m/2-p/2,0)),(r=i*b.scale)>1]<=t?i=s:a=s;return a};return this.x=e,this.y=t,this.lastIndex=e.length-1,this.interpolate=function(e){return e?(n=o(this.x,e),r=n-1,(e-this.x[r])*(this.y[n]-this.y[r])/(this.x[n]-this.x[r])+this.y[r]):0},this},getInterpolateFunction:function(e){var t=this;t.controller.spline||(t.controller.spline=t.params.loop?new V.LinearSpline(t.slidesGrid,e.slidesGrid):new V.LinearSpline(t.snapGrid,e.snapGrid))},setTranslate:function(e,t){var a,i,s=this,r=s.controller.control;function n(e){var t=s.rtlTranslate?-s.translate:s.translate;"slide"===s.params.controller.by&&(s.controller.getInterpolateFunction(e),i=-s.controller.spline.interpolate(-t)),i&&"container"!==s.params.controller.by||(a=(e.maxTranslate()-e.minTranslate())/(s.maxTranslate()-s.minTranslate()),i=(t-s.minTranslate())*a+e.minTranslate()),s.params.controller.inverse&&(i=e.maxTranslate()-i),e.updateProgress(i),e.setTranslate(i,s),e.updateActiveIndex(),e.updateSlidesClasses()}if(Array.isArray(r))for(var o=0;o'),i.append(e)),e.css({height:r+"px"})):0===(e=a.find(".swiper-cube-shadow")).length&&(e=L(''),a.append(e)));for(var h=0;h'),v.append(E)),0===S.length&&(S=L(''),v.append(S)),E.length&&(E[0].style.opacity=Math.max(-b,0)),S.length&&(S[0].style.opacity=Math.max(b,0))}}if(i.css({"-webkit-transform-origin":"50% 50% -"+l/2+"px","-moz-transform-origin":"50% 50% -"+l/2+"px","-ms-transform-origin":"50% 50% -"+l/2+"px","transform-origin":"50% 50% -"+l/2+"px"}),d.shadow)if(p)e.transform("translate3d(0px, "+(r/2+d.shadowOffset)+"px, "+-r/2+"px) rotateX(90deg) rotateZ(0deg) scale("+d.shadowScale+")");else{var C=Math.abs(u)-90*Math.floor(Math.abs(u)/90),M=1.5-(Math.sin(2*C*Math.PI/360)/2+Math.cos(2*C*Math.PI/360)/2),z=d.shadowScale,P=d.shadowScale/M,k=d.shadowOffset;e.transform("scale3d("+z+", 1, "+P+") translate3d(0px, "+(n/2+k)+"px, "+-n/2/P+"px) rotateX(-90deg)")}var $=I.isSafari||I.isUiWebView?-l/2:0;i.transform("translate3d(0px,0,"+$+"px) rotateX("+(t.isHorizontal()?0:u)+"deg) rotateY("+(t.isHorizontal()?-u:0)+"deg)")},setTransition:function(e){var t=this.$el;this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),this.params.cubeEffect.shadow&&!this.isHorizontal()&&t.find(".swiper-cube-shadow").transition(e)}},K={setTranslate:function(){for(var e=this,t=e.slides,a=e.rtlTranslate,i=0;i'),s.append(p)),0===c.length&&(c=L(''),s.append(c)),p.length&&(p[0].style.opacity=Math.max(-r,0)),c.length&&(c[0].style.opacity=Math.max(r,0))}s.transform("translate3d("+l+"px, "+d+"px, 0px) rotateX("+o+"deg) rotateY("+n+"deg)")}},setTransition:function(e){var a=this,t=a.slides,i=a.activeIndex,s=a.$wrapperEl;if(t.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),a.params.virtualTranslate&&0!==e){var r=!1;t.eq(i).transitionEnd(function(){if(!r&&a&&!a.destroyed){r=!0,a.animating=!1;for(var e=["webkitTransitionEnd","transitionend"],t=0;t'),v.append(E)),0===S.length&&(S=L(''),v.append(S)),E.length&&(E[0].style.opacity=0')}}),Object.keys(F).forEach(function(e){t.a11y[e]=F[e].bind(t)})},on:{init:function(){this.params.a11y.enabled&&(this.a11y.init(),this.a11y.updateNavigation())},toEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},fromEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},paginationUpdate:function(){this.params.a11y.enabled&&this.a11y.updatePagination()},destroy:function(){this.params.a11y.enabled&&this.a11y.destroy()}}},{name:"history",params:{history:{enabled:!1,replaceState:!1,key:"slides"}},create:function(){var e=this;ee.extend(e,{history:{init:R.init.bind(e),setHistory:R.setHistory.bind(e),setHistoryPopState:R.setHistoryPopState.bind(e),scrollToSlide:R.scrollToSlide.bind(e),destroy:R.destroy.bind(e)}})},on:{init:function(){this.params.history.enabled&&this.history.init()},destroy:function(){this.params.history.enabled&&this.history.destroy()},transitionEnd:function(){this.history.initialized&&this.history.setHistory(this.params.history.key,this.activeIndex)}}},{name:"hash-navigation",params:{hashNavigation:{enabled:!1,replaceState:!1,watchState:!1}},create:function(){var e=this;ee.extend(e,{hashNavigation:{initialized:!1,init:q.init.bind(e),destroy:q.destroy.bind(e),setHash:q.setHash.bind(e),onHashCange:q.onHashCange.bind(e)}})},on:{init:function(){this.params.hashNavigation.enabled&&this.hashNavigation.init()},destroy:function(){this.params.hashNavigation.enabled&&this.hashNavigation.destroy()},transitionEnd:function(){this.hashNavigation.initialized&&this.hashNavigation.setHash()}}},{name:"autoplay",params:{autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1}},create:function(){var t=this;ee.extend(t,{autoplay:{running:!1,paused:!1,run:W.run.bind(t),start:W.start.bind(t),stop:W.stop.bind(t),pause:W.pause.bind(t),onTransitionEnd:function(e){t&&!t.destroyed&&t.$wrapperEl&&e.target===this&&(t.$wrapperEl[0].removeEventListener("transitionend",t.autoplay.onTransitionEnd),t.$wrapperEl[0].removeEventListener("webkitTransitionEnd",t.autoplay.onTransitionEnd),t.autoplay.paused=!1,t.autoplay.running?t.autoplay.run():t.autoplay.stop())}}})},on:{init:function(){this.params.autoplay.enabled&&this.autoplay.start()},beforeTransitionStart:function(e,t){this.autoplay.running&&(t||!this.params.autoplay.disableOnInteraction?this.autoplay.pause(e):this.autoplay.stop())},sliderFirstMove:function(){this.autoplay.running&&(this.params.autoplay.disableOnInteraction?this.autoplay.stop():this.autoplay.pause())},destroy:function(){this.autoplay.running&&this.autoplay.stop()}}},{name:"effect-fade",params:{fadeEffect:{crossFade:!1}},create:function(){ee.extend(this,{fadeEffect:{setTranslate:j.setTranslate.bind(this),setTransition:j.setTransition.bind(this)}})},on:{beforeInit:function(){var e=this;if("fade"===e.params.effect){e.classNames.push(e.params.containerModifierClass+"fade");var t={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};ee.extend(e.params,t),ee.extend(e.originalParams,t)}},setTranslate:function(){"fade"===this.params.effect&&this.fadeEffect.setTranslate()},setTransition:function(e){"fade"===this.params.effect&&this.fadeEffect.setTransition(e)}}},{name:"effect-cube",params:{cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}},create:function(){ee.extend(this,{cubeEffect:{setTranslate:U.setTranslate.bind(this),setTransition:U.setTransition.bind(this)}})},on:{beforeInit:function(){var e=this;if("cube"===e.params.effect){e.classNames.push(e.params.containerModifierClass+"cube"),e.classNames.push(e.params.containerModifierClass+"3d");var t={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0};ee.extend(e.params,t),ee.extend(e.originalParams,t)}},setTranslate:function(){"cube"===this.params.effect&&this.cubeEffect.setTranslate()},setTransition:function(e){"cube"===this.params.effect&&this.cubeEffect.setTransition(e)}}},{name:"effect-flip",params:{flipEffect:{slideShadows:!0,limitRotation:!0}},create:function(){ee.extend(this,{flipEffect:{setTranslate:K.setTranslate.bind(this),setTransition:K.setTransition.bind(this)}})},on:{beforeInit:function(){var e=this;if("flip"===e.params.effect){e.classNames.push(e.params.containerModifierClass+"flip"),e.classNames.push(e.params.containerModifierClass+"3d");var t={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};ee.extend(e.params,t),ee.extend(e.originalParams,t)}},setTranslate:function(){"flip"===this.params.effect&&this.flipEffect.setTranslate()},setTransition:function(e){"flip"===this.params.effect&&this.flipEffect.setTransition(e)}}},{name:"effect-coverflow",params:{coverflowEffect:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0}},create:function(){ee.extend(this,{coverflowEffect:{setTranslate:_.setTranslate.bind(this),setTransition:_.setTransition.bind(this)}})},on:{beforeInit:function(){var e=this;"coverflow"===e.params.effect&&(e.classNames.push(e.params.containerModifierClass+"coverflow"),e.classNames.push(e.params.containerModifierClass+"3d"),e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0)},setTranslate:function(){"coverflow"===this.params.effect&&this.coverflowEffect.setTranslate()},setTransition:function(e){"coverflow"===this.params.effect&&this.coverflowEffect.setTransition(e)}}},{name:"thumbs",params:{thumbs:{swiper:null,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-container-thumbs"}},create:function(){ee.extend(this,{thumbs:{swiper:null,init:Z.init.bind(this),update:Z.update.bind(this),onThumbClick:Z.onThumbClick.bind(this)}})},on:{beforeInit:function(){var e=this.params.thumbs;e&&e.swiper&&(this.thumbs.init(),this.thumbs.update(!0))},slideChange:function(){this.thumbs.swiper&&this.thumbs.update()},update:function(){this.thumbs.swiper&&this.thumbs.update()},resize:function(){this.thumbs.swiper&&this.thumbs.update()},observerUpdate:function(){this.thumbs.swiper&&this.thumbs.update()},setTransition:function(e){var t=this.thumbs.swiper;t&&t.setTransition(e)},beforeDestroy:function(){var e=this.thumbs.swiper;e&&this.thumbs.swiperCreated&&e&&e.destroy()}}}];return void 0===T.use&&(T.use=T.Class.use,T.installModule=T.Class.installModule),T.use(Q),T});
})(jQuery);
jQuery.fn.slideLeftHide = function(speed, callback) {
this.animate({
width: "hide",
paddingLeft: "hide",
paddingRight: "hide",
marginLeft: "hide",
marginRight: "hide"
}, speed, callback);
}
jQuery.fn.slideLeftShow = function(speed, callback) {
this.animate({
width: "show",
paddingLeft: "show",
paddingRight: "show",
marginLeft: "show",
marginRight: "show"
}, speed, callback);
}
window['getUrlParameter'] = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
};
(function() {
window['CAFE24-COUNTRY'] = {
code: 'ko_KR',
use: true // 로컬개발용 언어변환 코드: 배포시에는 (false : 작동해제) 여야 합니다.
};
window['CAFE24-COUNTRY'].changeTextCode = function( LANGUAGE, SCOPE ) {
if ( !window['CAFE24-COUNTRY'].use ) return;
if ( getUrlParameter('langcode') ) window['CAFE24-COUNTRY'].code = getUrlParameter('langcode');
var currentLanguage = LANGUAGE[ window['CAFE24-COUNTRY'].code ],
$targetBlock = $( '.' + SCOPE ),
pickupStr = $targetBlock.html();
Object.keys( currentLanguage ).forEach(function(key) {
pickupStr = pickupStr.replace( new RegExp("#" + key + "#", 'g') , currentLanguage[key] );
});
$targetBlock.html( pickupStr );
};
})();
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false;
function gridCompatibilityforIE( contextSelector ) {
var $gridContext = $(contextSelector),
$gridItem = $gridContext.find('>.gridItem'),
hasGridTemplate,
splitGridTemplate = {},
msGridTemplateStyle = '';
function getInlineStyle($el, prop) {
var styles = $el.attr("style"),
value;
styles && styles.split(";").forEach(function (e) {
var style = e.split(":");
if ($.trim(style[0]) === prop) {
value = style[1];
}
});
return value;
}
function changeRepeatStyle(a, b) {
var countStr = '';
for(var i=0, k = a; i colgroup').find('col').eq(0).width(98);
$('.xans-mall-supplyinfo, .supplyInfo').find('th, td').css({padding:'13px 10px 12px'});
/**
* 상단탑버튼
*/
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').length > 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 = $('');
$('#aside').after('');
var offCover = {
init : function() {
$(function() {
offCover.resize();
$(window).resize(function(){
offCover.resize();
});
});
},
layout : function(){
if ($('html').hasClass('expand')) {
$('#aside').css({'visibility':'visible'});
$('html, body').css({"overflow-x":""})
} else {
setTimeout(function(){
$('#aside').css({'visibility':''});
}, 300);
}
$('#aside').css({'visibility':'visible'});
},
resize : function(){
//var height = $('body').height();
//var height = window.innerHeight;
var height = $(window).height();
//alert(height);
$('#container').css({'min-height':height});
}
};
offCover.init();
$('#header .btnCate, #m-open-menu, #aside .btnClose, .btnNav.eNavFold').click(function(e){
e.preventDefault();
$('#dimmedSlider').toggle();
$('#dimed').toggle();
$('html').toggleClass('expand');
$('#dimmedSlider, #dimed').one('click', function(e) {
$('html').toggleClass('expand');
$('#dimmedSlider').toggle();
$('#dimed').toggle();
offCover.layout();
});
offCover.layout();
});
$(".xans-layout-multishoplist .xans-multishop-listitem .countryLink").on("click", function(e) {
$('#dimmedSlider').toggle();
$('#dimed').toggle();
$('html').toggleClass('expand');
offCover.layout();
$(".xans-layout-multishopshipping").show();
e.preventDefault();
});
$(".xans-layout-multishoplist .xans-multishop-listitem .languageLink").on("click", function(e) {
$('#dimmedSlider').toggle();
$('#dimed').toggle();
$('html').toggleClass('expand');
offCover.layout();
$(".xans-layout-multishopshipping").show();
e.preventDefault();
});
if( getUrlParameter('PREVIEW_SDE') == 1 ) {
// $('#header .btnCate').trigger('click');
}
$('.xans-layout-boardinfo a').each(function() {
var href = $(this).attr('href');
if(href){
if (href.indexOf('?') > -1) {
/*
if (getParamUrl('board_no', href) == '5') {
$(this).attr('href', href.replace('/free/', '/magazine/'));
}
*/
if (getParamUrl('board_no', href) == '1') {
$(this).attr('href', href.replace('/free/', '/news/'));
}
if (getParamUrl('board_no', href) == '2') {
$(this).attr('href', href.replace('/free/', '/media/'));
}
if (getParamUrl('board_no', href) == '3') {
$(this).attr('href', href.replace('/free/', '/faq/'));
}
if (getParamUrl('board_no', href) == '101') {
$(this).attr('href', href.replace('/product/', '/video/'));
}
}
}
});
//나의게시글부분 href추가
$('.xans-myshop-boardlist.ec-base-table.typeList td.subject a').each(function() {
var href = $(this).attr('href');
if(href){
if (href.indexOf('?') > -1) {
/*
if (getParamUrl('board_no', href) == '5') {
$(this).attr('href', href.replace('/free/', '/magazine/'));
}
*/
if (getParamUrl('board_no', href) == '101') {
$(this).attr('href', href.replace('/product/', '/video/'));
}
if (getParamUrl('board_no', href) == '1') {
$(this).attr('href', href.replace('/free/', '/news/'));
}
if (getParamUrl('board_no', href) == '2') {
$(this).attr('href', href.replace('/free/', '/media/'));
}
if (getParamUrl('board_no', href) == '3') {
$(this).attr('href', href.replace('/free/', '/faq/'));
}
}
}
});
/* /board/review/ 활성화 일경우 주석해제 */
/*
// 리뷰 경로 재설정 추가
$('.xans-layout-boardinfo a').each(function() {
var href = $(this).attr('href');
if(href){
if (href.indexOf('?') > -1) {
if (getParamUrl('board_no', href) == '4') {
$(this).attr('href', href.replace('/product/', '/review/'));
}
if (getParamUrl('board_no', href) == '5') {
$(this).attr('href', href.replace('/free/', '/magazine/'));
}
if (getParamUrl('board_no', href) == '1002') { // 지점안내
$(this).attr('href', href.replace('/free/', '/branch/'));
}
}
}
});
//리뷰 경로 재설정 추가
$('.-header .-logstate a').each(function() {
var href = $(this).attr('href');
if (href.indexOf('?') > -1) {
if (getParamUrl('board_no', href) == '4') {
$(this).attr('href', href.replace('/product/list', '/review/list'));
}
}
});
//리뷰 경로 재설정 추가
$('.footer-quick a').each(function() {
var href = $(this).attr('href');
if (href.indexOf('?') > -1) {
if (getParamUrl('board_no', href) == '4') {
$(this).attr('href', href.replace('/product/list', '/review/list'));
}
}
});
//상세페이지 리뷰전체보기 경로 재설정
$('#prdReview .board_title a').each(function() {
var href = $(this).attr('href');
if (href.indexOf('?') > -1) {
if (getParamUrl('board_no', href) == '4') {
$(this).attr('href', href.replace('/product/', '/review/'));
}
}
});
//리뷰 경로 재설정 추가
$('.ec-base-button a').each(function() {
var href = $(this).attr('href');
if (href.indexOf('?') > -1) {
if (getParamUrl('board_no', href) == '4') {
$(this).attr('href', href.replace('/product/list', '/review/list'));
}
}
});
*/
$('.-sub-section.-partners .prdList li a').each(function() {
var href = $(this).attr('data-href');
if(href){
$(this).attr('href', href);
}
});
});
/*! nanoScrollerJS - v0.8.6 - 2015
* http://jamesflorentino.github.com/nanoScrollerJS/
* Copyright (c) 2015 James Florentino; Licensed MIT */
(function(factory) {
if (typeof define === 'function' && define.amd) {
return define(['jquery'], function($) {
return factory($, window, document);
});
} else if (typeof exports === 'object') {
return module.exports = factory(require('jquery'), window, document);
} else {
return factory(jQuery, window, document);
}
})(function($, window, document) {
"use strict";
var BROWSER_IS_IE7, BROWSER_SCROLLBAR_WIDTH, DOMSCROLL, DOWN, DRAG, ENTER, KEYDOWN, KEYUP, MOUSEDOWN, MOUSEENTER, MOUSEMOVE, MOUSEUP, MOUSEWHEEL, NanoScroll, PANEDOWN, RESIZE, SCROLL, SCROLLBAR, TOUCHMOVE, UP, WHEEL, cAF, defaults, getBrowserScrollbarWidth, hasTransform, isFFWithBuggyScrollbar, rAF, transform, _elementStyle, _prefixStyle, _vendor;
defaults = {
/**
a classname for the pane element.
@property paneClass
@type String
@default 'nano-pane'
*/
paneClass: 'nano-pane',
/**
a classname for the slider element.
@property sliderClass
@type String
@default 'nano-slider'
*/
sliderClass: 'nano-slider',
/**
a classname for the content element.
@property contentClass
@type String
@default 'nano-content'
*/
contentClass: 'nano-content',
/**
a setting to enable native scrolling in iOS devices.
@property iOSNativeScrolling
@type Boolean
@default false
*/
iOSNativeScrolling: false,
/**
a setting to prevent the rest of the page being
scrolled when user scrolls the `.content` element.
@property preventPageScrolling
@type Boolean
@default false
*/
preventPageScrolling: true,
/**
a setting to disable binding to the resize event.
@property disableResize
@type Boolean
@default false
*/
disableResize: false,
/**
a setting to make the scrollbar always visible.
@property alwaysVisible
@type Boolean
@default false
*/
alwaysVisible: false,
/**
a default timeout for the `flash()` method.
@property flashDelay
@type Number
@default 1500
*/
flashDelay: 1500,
/**
a minimum height for the `.slider` element.
@property sliderMinHeight
@type Number
@default 20
*/
sliderMinHeight: 20,
/**
a maximum height for the `.slider` element.
@property sliderMaxHeight
@type Number
@default null
*/
sliderMaxHeight: null,
/**
an alternate document context.
@property documentContext
@type Document
@default null
*/
documentContext: null,
/**
an alternate window context.
@property windowContext
@type Window
@default null
*/
windowContext: null
};
/**
@property SCROLLBAR
@type String
@static
@final
@private
*/
SCROLLBAR = 'scrollbar';
/**
@property SCROLL
@type String
@static
@final
@private
*/
SCROLL = 'scroll';
/**
@property MOUSEDOWN
@type String
@final
@private
*/
MOUSEDOWN = 'mousedown';
/**
@property MOUSEENTER
@type String
@final
@private
*/
MOUSEENTER = 'mouseenter';
/**
@property MOUSEMOVE
@type String
@static
@final
@private
*/
MOUSEMOVE = 'mousemove';
/**
@property MOUSEWHEEL
@type String
@final
@private
*/
MOUSEWHEEL = 'mousewheel';
/**
@property MOUSEUP
@type String
@static
@final
@private
*/
MOUSEUP = 'mouseup';
/**
@property RESIZE
@type String
@final
@private
*/
RESIZE = 'resize';
/**
@property DRAG
@type String
@static
@final
@private
*/
DRAG = 'drag';
/**
@property ENTER
@type String
@static
@final
@private
*/
ENTER = 'enter';
/**
@property UP
@type String
@static
@final
@private
*/
UP = 'up';
/**
@property PANEDOWN
@type String
@static
@final
@private
*/
PANEDOWN = 'panedown';
/**
@property DOMSCROLL
@type String
@static
@final
@private
*/
DOMSCROLL = 'DOMMouseScroll';
/**
@property DOWN
@type String
@static
@final
@private
*/
DOWN = 'down';
/**
@property WHEEL
@type String
@static
@final
@private
*/
WHEEL = 'wheel';
/**
@property KEYDOWN
@type String
@static
@final
@private
*/
KEYDOWN = 'keydown';
/**
@property KEYUP
@type String
@static
@final
@private
*/
KEYUP = 'keyup';
/**
@property TOUCHMOVE
@type String
@static
@final
@private
*/
TOUCHMOVE = 'touchmove';
/**
@property BROWSER_IS_IE7
@type Boolean
@static
@final
@private
*/
BROWSER_IS_IE7 = window.navigator.appName === 'Microsoft Internet Explorer' && /msie 7./i.test(window.navigator.appVersion) && window.ActiveXObject;
/**
@property BROWSER_SCROLLBAR_WIDTH
@type Number
@static
@default null
@private
*/
BROWSER_SCROLLBAR_WIDTH = null;
rAF = window.requestAnimationFrame;
cAF = window.cancelAnimationFrame;
_elementStyle = document.createElement('div').style;
_vendor = (function() {
var i, transform, vendor, vendors, _i, _len;
vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'];
for (i = _i = 0, _len = vendors.length; _i < _len; i = ++_i) {
vendor = vendors[i];
transform = vendors[i] + 'ransform';
if (transform in _elementStyle) {
return vendors[i].substr(0, vendors[i].length - 1);
}
}
return false;
})();
_prefixStyle = function(style) {
if (_vendor === false) {
return false;
}
if (_vendor === '') {
return style;
}
return _vendor + style.charAt(0).toUpperCase() + style.substr(1);
};
transform = _prefixStyle('transform');
hasTransform = transform !== false;
/**
Returns browser's native scrollbar width
@method getBrowserScrollbarWidth
@return {Number} the scrollbar width in pixels
@static
@private
*/
getBrowserScrollbarWidth = function() {
var outer, outerStyle, scrollbarWidth;
outer = document.createElement('div');
outerStyle = outer.style;
outerStyle.position = 'absolute';
outerStyle.width = '100px';
outerStyle.height = '100px';
outerStyle.overflow = SCROLL;
outerStyle.top = '-9999px';
document.body.appendChild(outer);
scrollbarWidth = outer.offsetWidth - outer.clientWidth;
document.body.removeChild(outer);
return scrollbarWidth;
};
isFFWithBuggyScrollbar = function() {
var isOSXFF, ua, version;
ua = window.navigator.userAgent;
isOSXFF = /(?=.+Mac OS X)(?=.+Firefox)/.test(ua);
if (!isOSXFF) {
return false;
}
version = /Firefox\/\d{2}\./.exec(ua);
if (version) {
version = version[0].replace(/\D+/g, '');
}
return isOSXFF && +version > 23;
};
/**
@class NanoScroll
@param element {HTMLElement|Node} the main element
@param options {Object} nanoScroller's options
@constructor
*/
NanoScroll = (function() {
function NanoScroll(el, options) {
this.el = el;
this.options = options;
BROWSER_SCROLLBAR_WIDTH || (BROWSER_SCROLLBAR_WIDTH = getBrowserScrollbarWidth());
this.$el = $(this.el);
this.doc = $(this.options.documentContext || document);
this.win = $(this.options.windowContext || window);
this.body = this.doc.find('body');
this.$content = this.$el.children("." + this.options.contentClass);
this.$content.attr('tabindex', this.options.tabIndex || 0);
this.content = this.$content[0];
this.previousPosition = 0;
if (this.options.iOSNativeScrolling && (this.el.style.WebkitOverflowScrolling != null)) {
this.nativeScrolling();
} else {
this.generate();
}
this.createEvents();
this.addEvents();
this.reset();
}
/**
Prevents the rest of the page being scrolled
when user scrolls the `.nano-content` element.
@method preventScrolling
@param event {Event}
@param direction {String} Scroll direction (up or down)
@private
*/
NanoScroll.prototype.preventScrolling = function(e, direction) {
if (!this.isActive) {
return;
}
if (e.type === DOMSCROLL) {
if (direction === DOWN && e.originalEvent.detail > 0 || direction === UP && e.originalEvent.detail < 0) {
e.preventDefault();
}
} else if (e.type === MOUSEWHEEL) {
if (!e.originalEvent || !e.originalEvent.wheelDelta) {
return;
}
if (direction === DOWN && e.originalEvent.wheelDelta < 0 || direction === UP && e.originalEvent.wheelDelta > 0) {
e.preventDefault();
}
}
};
/**
Enable iOS native scrolling
@method nativeScrolling
@private
*/
NanoScroll.prototype.nativeScrolling = function() {
this.$content.css({
WebkitOverflowScrolling: 'touch'
});
this.iOSNativeScrolling = true;
this.isActive = true;
};
/**
Updates those nanoScroller properties that
are related to current scrollbar position.
@method updateScrollValues
@private
*/
NanoScroll.prototype.updateScrollValues = function() {
var content, direction;
content = this.content;
this.maxScrollTop = content.scrollHeight - content.clientHeight;
this.prevScrollTop = this.contentScrollTop || 0;
this.contentScrollTop = content.scrollTop;
direction = this.contentScrollTop > this.previousPosition ? "down" : this.contentScrollTop < this.previousPosition ? "up" : "same";
this.previousPosition = this.contentScrollTop;
if (direction !== "same") {
this.$el.trigger('update', {
position: this.contentScrollTop,
maximum: this.maxScrollTop,
direction: direction
});
}
if (!this.iOSNativeScrolling) {
this.maxSliderTop = this.paneHeight - this.sliderHeight;
this.sliderTop = this.maxScrollTop === 0 ? 0 : this.contentScrollTop * this.maxSliderTop / this.maxScrollTop;
}
};
/**
Updates CSS styles for current scroll position.
Uses CSS 2d transfroms and `window.requestAnimationFrame` if available.
@method setOnScrollStyles
@private
*/
NanoScroll.prototype.setOnScrollStyles = function() {
var cssValue;
if (hasTransform) {
cssValue = {};
cssValue[transform] = "translate(0, " + this.sliderTop + "px)";
} else {
cssValue = {
top: this.sliderTop
};
}
if (rAF) {
if (cAF && this.scrollRAF) {
cAF(this.scrollRAF);
}
this.scrollRAF = rAF((function(_this) {
return function() {
_this.scrollRAF = null;
return _this.slider.css(cssValue);
};
})(this));
} else {
this.slider.css(cssValue);
}
};
/**
Creates event related methods
@method createEvents
@private
*/
NanoScroll.prototype.createEvents = function() {
this.events = {
down: (function(_this) {
return function(e) {
_this.isBeingDragged = true;
_this.offsetY = e.pageY - _this.slider.offset().top;
if (!_this.slider.is(e.target)) {
_this.offsetY = 0;
}
_this.pane.addClass('active');
_this.doc.bind(MOUSEMOVE, _this.events[DRAG]).bind(MOUSEUP, _this.events[UP]);
_this.body.bind(MOUSEENTER, _this.events[ENTER]);
return false;
};
})(this),
drag: (function(_this) {
return function(e) {
_this.sliderY = e.pageY - _this.$el.offset().top - _this.paneTop - (_this.offsetY || _this.sliderHeight * 0.5);
_this.scroll();
if (_this.contentScrollTop >= _this.maxScrollTop && _this.prevScrollTop !== _this.maxScrollTop) {
_this.$el.trigger('scrollend');
} else if (_this.contentScrollTop === 0 && _this.prevScrollTop !== 0) {
_this.$el.trigger('scrolltop');
}
return false;
};
})(this),
up: (function(_this) {
return function(e) {
_this.isBeingDragged = false;
_this.pane.removeClass('active');
_this.doc.unbind(MOUSEMOVE, _this.events[DRAG]).unbind(MOUSEUP, _this.events[UP]);
_this.body.unbind(MOUSEENTER, _this.events[ENTER]);
return false;
};
})(this),
resize: (function(_this) {
return function(e) {
_this.reset();
};
})(this),
panedown: (function(_this) {
return function(e) {
_this.sliderY = (e.offsetY || e.originalEvent.layerY) - (_this.sliderHeight * 0.5);
_this.scroll();
_this.events.down(e);
return false;
};
})(this),
scroll: (function(_this) {
return function(e) {
_this.updateScrollValues();
if (_this.isBeingDragged) {
return;
}
if (!_this.iOSNativeScrolling) {
_this.sliderY = _this.sliderTop;
_this.setOnScrollStyles();
}
if (e == null) {
return;
}
if (_this.contentScrollTop >= _this.maxScrollTop) {
if (_this.options.preventPageScrolling) {
_this.preventScrolling(e, DOWN);
}
if (_this.prevScrollTop !== _this.maxScrollTop) {
_this.$el.trigger('scrollend');
}
} else if (_this.contentScrollTop === 0) {
if (_this.options.preventPageScrolling) {
_this.preventScrolling(e, UP);
}
if (_this.prevScrollTop !== 0) {
_this.$el.trigger('scrolltop');
}
}
};
})(this),
wheel: (function(_this) {
return function(e) {
var delta;
if (e == null) {
return;
}
delta = e.delta || e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.detail || (e.originalEvent && -e.originalEvent.detail);
if (delta) {
_this.sliderY += -delta / 3;
}
_this.scroll();
return false;
};
})(this),
enter: (function(_this) {
return function(e) {
var _ref;
if (!_this.isBeingDragged) {
return;
}
if ((e.buttons || e.which) !== 1) {
return (_ref = _this.events)[UP].apply(_ref, arguments);
}
};
})(this)
};
};
/**
Adds event listeners with jQuery.
@method addEvents
@private
*/
NanoScroll.prototype.addEvents = function() {
var events;
this.removeEvents();
events = this.events;
if (!this.options.disableResize) {
this.win.bind(RESIZE, events[RESIZE]);
}
if (!this.iOSNativeScrolling) {
this.slider.bind(MOUSEDOWN, events[DOWN]);
this.pane.bind(MOUSEDOWN, events[PANEDOWN]).bind("" + MOUSEWHEEL + " " + DOMSCROLL, events[WHEEL]);
}
this.$content.bind("" + SCROLL + " " + MOUSEWHEEL + " " + DOMSCROLL + " " + TOUCHMOVE, events[SCROLL]);
};
/**
Removes event listeners with jQuery.
@method removeEvents
@private
*/
NanoScroll.prototype.removeEvents = function() {
var events;
events = this.events;
this.win.unbind(RESIZE, events[RESIZE]);
if (!this.iOSNativeScrolling) {
this.slider.unbind();
this.pane.unbind();
}
this.$content.unbind("" + SCROLL + " " + MOUSEWHEEL + " " + DOMSCROLL + " " + TOUCHMOVE, events[SCROLL]);
};
/**
Generates nanoScroller's scrollbar and elements for it.
@method generate
@chainable
@private
*/
NanoScroll.prototype.generate = function() {
var contentClass, cssRule, currentPadding, options, pane, paneClass, sliderClass;
options = this.options;
paneClass = options.paneClass, sliderClass = options.sliderClass, contentClass = options.contentClass;
if (!(pane = this.$el.children("." + paneClass)).length && !pane.children("." + sliderClass).length) {
this.$el.append("");
}
this.pane = this.$el.children("." + paneClass);
this.slider = this.pane.find("." + sliderClass);
if (BROWSER_SCROLLBAR_WIDTH === 0 && isFFWithBuggyScrollbar()) {
currentPadding = window.getComputedStyle(this.content, null).getPropertyValue('padding-right').replace(/[^0-9.]+/g, '');
cssRule = {
right: -14,
paddingRight: +currentPadding + 14
};
} else if (BROWSER_SCROLLBAR_WIDTH) {
cssRule = {
right: -BROWSER_SCROLLBAR_WIDTH
};
this.$el.addClass('has-scrollbar');
}
if (cssRule != null) {
this.$content.css(cssRule);
}
return this;
};
/**
@method restore
@private
*/
NanoScroll.prototype.restore = function() {
this.stopped = false;
if (!this.iOSNativeScrolling) {
this.pane.show();
}
this.addEvents();
};
/**
Resets nanoScroller's scrollbar.
@method reset
@chainable
@example
$(".nano").nanoScroller();
*/
NanoScroll.prototype.reset = function() {
var content, contentHeight, contentPosition, contentStyle, contentStyleOverflowY, paneBottom, paneHeight, paneOuterHeight, paneTop, parentMaxHeight, right, sliderHeight;
if (this.iOSNativeScrolling) {
this.contentHeight = this.content.scrollHeight;
return;
}
if (!this.$el.find("." + this.options.paneClass).length) {
this.generate().stop();
}
if (this.stopped) {
this.restore();
}
content = this.content;
contentStyle = content.style;
contentStyleOverflowY = contentStyle.overflowY;
if (BROWSER_IS_IE7) {
this.$content.css({
height: this.$content.height()
});
}
contentHeight = content.scrollHeight + BROWSER_SCROLLBAR_WIDTH;
parentMaxHeight = parseInt(this.$el.css("max-height"), 10);
if (parentMaxHeight > 0) {
this.$el.height("");
this.$el.height(content.scrollHeight > parentMaxHeight ? parentMaxHeight : content.scrollHeight);
}
paneHeight = this.pane.outerHeight(false);
paneTop = parseInt(this.pane.css('top'), 10);
paneBottom = parseInt(this.pane.css('bottom'), 10);
paneOuterHeight = paneHeight + paneTop + paneBottom;
sliderHeight = Math.round(paneOuterHeight / contentHeight * paneHeight);
if (sliderHeight < this.options.sliderMinHeight) {
sliderHeight = this.options.sliderMinHeight;
} else if ((this.options.sliderMaxHeight != null) && sliderHeight > this.options.sliderMaxHeight) {
sliderHeight = this.options.sliderMaxHeight;
}
if (contentStyleOverflowY === SCROLL && contentStyle.overflowX !== SCROLL) {
sliderHeight += BROWSER_SCROLLBAR_WIDTH;
}
this.maxSliderTop = paneOuterHeight - sliderHeight;
this.contentHeight = contentHeight;
this.paneHeight = paneHeight;
this.paneOuterHeight = paneOuterHeight;
this.sliderHeight = sliderHeight;
this.paneTop = paneTop;
this.slider.height(sliderHeight);
this.events.scroll();
this.pane.show();
this.isActive = true;
if ((content.scrollHeight === content.clientHeight) || (this.pane.outerHeight(true) >= content.scrollHeight && contentStyleOverflowY !== SCROLL)) {
this.pane.hide();
this.isActive = false;
} else if (this.el.clientHeight === content.scrollHeight && contentStyleOverflowY === SCROLL) {
this.slider.hide();
} else {
this.slider.show();
}
this.pane.css({
opacity: (this.options.alwaysVisible ? 1 : ''),
visibility: (this.options.alwaysVisible ? 'visible' : '')
});
contentPosition = this.$content.css('position');
if (contentPosition === 'static' || contentPosition === 'relative') {
right = parseInt(this.$content.css('right'), 10);
if (right) {
this.$content.css({
right: '',
marginRight: right
});
}
}
return this;
};
/**
@method scroll
@private
@example
$(".nano").nanoScroller({ scroll: 'top' });
*/
NanoScroll.prototype.scroll = function() {
if (!this.isActive) {
return;
}
this.sliderY = Math.max(0, this.sliderY);
this.sliderY = Math.min(this.maxSliderTop, this.sliderY);
this.$content.scrollTop(this.maxScrollTop * this.sliderY / this.maxSliderTop);
if (!this.iOSNativeScrolling) {
this.updateScrollValues();
this.setOnScrollStyles();
}
return this;
};
/**
Scroll at the bottom with an offset value
@method scrollBottom
@param offsetY {Number}
@chainable
@example
$(".nano").nanoScroller({ scrollBottom: value });
*/
NanoScroll.prototype.scrollBottom = function(offsetY) {
if (!this.isActive) {
return;
}
this.$content.scrollTop(this.contentHeight - this.$content.height() - offsetY).trigger(MOUSEWHEEL);
this.stop().restore();
return this;
};
/**
Scroll at the top with an offset value
@method scrollTop
@param offsetY {Number}
@chainable
@example
$(".nano").nanoScroller({ scrollTop: value });
*/
NanoScroll.prototype.scrollTop = function(offsetY) {
if (!this.isActive) {
return;
}
this.$content.scrollTop(+offsetY).trigger(MOUSEWHEEL);
this.stop().restore();
return this;
};
/**
Scroll to an element
@method scrollTo
@param node {Node} A node to scroll to.
@chainable
@example
$(".nano").nanoScroller({ scrollTo: $('#a_node') });
*/
NanoScroll.prototype.scrollTo = function(node) {
if (!this.isActive) {
return;
}
this.scrollTop(this.$el.find(node).get(0).offsetTop);
return this;
};
/**
To stop the operation.
This option will tell the plugin to disable all event bindings and hide the gadget scrollbar from the UI.
@method stop
@chainable
@example
$(".nano").nanoScroller({ stop: true });
*/
NanoScroll.prototype.stop = function() {
if (cAF && this.scrollRAF) {
cAF(this.scrollRAF);
this.scrollRAF = null;
}
this.stopped = true;
this.removeEvents();
if (!this.iOSNativeScrolling) {
this.pane.hide();
}
return this;
};
/**
Destroys nanoScroller and restores browser's native scrollbar.
@method destroy
@chainable
@example
$(".nano").nanoScroller({ destroy: true });
*/
NanoScroll.prototype.destroy = function() {
if (!this.stopped) {
this.stop();
}
if (!this.iOSNativeScrolling && this.pane.length) {
this.pane.remove();
}
if (BROWSER_IS_IE7) {
this.$content.height('');
}
this.$content.removeAttr('tabindex');
if (this.$el.hasClass('has-scrollbar')) {
this.$el.removeClass('has-scrollbar');
this.$content.css({
right: ''
});
}
return this;
};
/**
To flash the scrollbar gadget for an amount of time defined in plugin settings (defaults to 1,5s).
Useful if you want to show the user (e.g. on pageload) that there is more content waiting for him.
@method flash
@chainable
@example
$(".nano").nanoScroller({ flash: true });
*/
NanoScroll.prototype.flash = function() {
if (this.iOSNativeScrolling) {
return;
}
if (!this.isActive) {
return;
}
this.reset();
this.pane.addClass('flashed');
setTimeout((function(_this) {
return function() {
_this.pane.removeClass('flashed');
};
})(this), this.options.flashDelay);
return this;
};
return NanoScroll;
})();
$.fn.nanoScroller = function(settings) {
return this.each(function() {
var options, scrollbar;
if (!(scrollbar = this.nanoscroller)) {
options = $.extend({}, defaults, settings);
this.nanoscroller = scrollbar = new NanoScroll(this, options);
}
if (settings && typeof settings === "object") {
$.extend(scrollbar.options, settings);
if (settings.scrollBottom != null) {
return scrollbar.scrollBottom(settings.scrollBottom);
}
if (settings.scrollTop != null) {
return scrollbar.scrollTop(settings.scrollTop);
}
if (settings.scrollTo) {
return scrollbar.scrollTo(settings.scrollTo);
}
if (settings.scroll === 'bottom') {
return scrollbar.scrollBottom(0);
}
if (settings.scroll === 'top') {
return scrollbar.scrollTop(0);
}
if (settings.scroll && settings.scroll instanceof $) {
return scrollbar.scrollTo(settings.scroll);
}
if (settings.stop) {
return scrollbar.stop();
}
if (settings.destroy) {
return scrollbar.destroy();
}
if (settings.flash) {
return scrollbar.flash();
}
}
return scrollbar.reset();
});
};
$.fn.nanoScroller.Constructor = NanoScroll;
});
/*
_ _ _ _
___| (_) ___| | __ (_)___
/ __| | |/ __| |/ / | / __|
\__ \ | | (__| < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
|__/
Version: 1.8.0
Author: Ken Wheeler
Website: http://kenwheeler.github.io
Docs: http://kenwheeler.github.io/slick
Repo: http://github.com/kenwheeler/slick
Issues: http://github.com/kenwheeler/slick/issues
*/
/* global window, document, define, jQuery, setInterval, clearInterval */
(function( $ ) {
'use strict';
var Slick = window.Slick || {};
Slick = (function() {
var instanceUid = 0;
function Slick(element, settings) {
var _ = this, dataSettings;
_.defaults = {
accessibility: true,
adaptiveHeight: false,
appendArrows: $(element),
appendDots: $(element),
arrows: true,
asNavFor: null,
prevArrow: '
Previous',
nextArrow: '
Next',
autoplay: false,
autoplaySpeed: 3000,
centerMode: false,
centerPadding: '50px',
cssEase: 'ease',
customPaging: function(slider, i) {
return $('').text(i + 1);
},
dots: false,
dotsClass: 'slick-dots',
draggable: false,
easing: 'linear',
edgeFriction: 0.35,
fade: false,
focusOnSelect: false,
focusOnChange: false,
infinite: true,
initialSlide: 0,
lazyLoad: 'ondemand',
mobileFirst: false,
pauseOnHover: true,
pauseOnFocus: true,
pauseOnDotsHover: false,
respondTo: 'window',
responsive: null,
rows: 1,
rtl: false,
slide: '',
slidesPerRow: 1,
slidesToShow: 1,
slidesToScroll: 1,
speed: 500,
swipe: true,
swipeToSlide: false,
touchMove: true,
touchThreshold: 5,
useCSS: true,
useTransform: true,
variableWidth: false,
vertical: false,
verticalSwiping: false,
waitForAnimate: true,
zIndex: 1000
};
_.initials = {
animating: false,
dragging: false,
autoPlayTimer: null,
currentDirection: 0,
currentLeft: null,
currentSlide: 0,
direction: 1,
$dots: null,
listWidth: null,
listHeight: null,
loadIndex: 0,
$nextArrow: null,
$prevArrow: null,
scrolling: false,
slideCount: null,
slideWidth: null,
$slideTrack: null,
$slides: null,
sliding: false,
slideOffset: 0,
swipeLeft: null,
swiping: false,
$list: null,
touchObject: {},
transformsEnabled: false,
unslicked: false
};
$.extend(_, _.initials);
_.activeBreakpoint = null;
_.animType = null;
_.animProp = null;
_.breakpoints = [];
_.breakpointSettings = [];
_.cssTransitions = false;
_.focussed = false;
_.interrupted = false;
_.hidden = 'hidden';
_.paused = true;
_.positionProp = null;
_.respondTo = null;
_.rowCount = 1;
_.shouldClick = true;
_.$slider = $(element);
_.$slidesCache = null;
_.transformType = null;
_.transitionType = null;
_.visibilityChange = 'visibilitychange';
_.windowWidth = 0;
_.windowTimer = null;
dataSettings = $(element).data('slick') || {};
_.options = $.extend({}, _.defaults, settings, dataSettings);
_.currentSlide = _.options.initialSlide;
_.originalSettings = _.options;
if (typeof document.mozHidden !== 'undefined') {
_.hidden = 'mozHidden';
_.visibilityChange = 'mozvisibilitychange';
} else if (typeof document.webkitHidden !== 'undefined') {
_.hidden = 'webkitHidden';
_.visibilityChange = 'webkitvisibilitychange';
}
_.autoPlay = $.proxy(_.autoPlay, _);
_.autoPlayClear = $.proxy(_.autoPlayClear, _);
_.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
_.changeSlide = $.proxy(_.changeSlide, _);
_.clickHandler = $.proxy(_.clickHandler, _);
_.selectHandler = $.proxy(_.selectHandler, _);
_.setPosition = $.proxy(_.setPosition, _);
_.swipeHandler = $.proxy(_.swipeHandler, _);
_.dragHandler = $.proxy(_.dragHandler, _);
_.keyHandler = $.proxy(_.keyHandler, _);
_.instanceUid = instanceUid++;
// A simple way to check for HTML strings
// Strict HTML recognition (must start with <)
// Extracted from jQuery v1.11 source
_.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
_.registerBreakpoints();
_.init(true);
}
return Slick;
}());
Slick.prototype.activateADA = function() {
var _ = this;
_.$slideTrack.find('.slick-active').attr({
'aria-hidden': 'false'
}).find('a, input, button, select').attr({
'tabindex': '0'
});
};
Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
var _ = this;
if (typeof(index) === 'boolean') {
addBefore = index;
index = null;
} else if (index < 0 || (index >= _.slideCount)) {
return false;
}
_.unload();
if (typeof(index) === 'number') {
if (index === 0 && _.$slides.length === 0) {
$(markup).appendTo(_.$slideTrack);
} else if (addBefore) {
$(markup).insertBefore(_.$slides.eq(index));
} else {
$(markup).insertAfter(_.$slides.eq(index));
}
} else {
if (addBefore === true) {
$(markup).prependTo(_.$slideTrack);
} else {
$(markup).appendTo(_.$slideTrack);
}
}
_.$slides = _.$slideTrack.children(this.options.slide);
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.append(_.$slides);
_.$slides.each(function(index, element) {
$(element).attr('data-slick-index', index);
});
_.$slidesCache = _.$slides;
_.reinit();
};
Slick.prototype.animateHeight = function() {
var _ = this;
if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
_.$list.animate({
height: targetHeight
}, _.options.speed);
}
};
Slick.prototype.animateSlide = function(targetLeft, callback) {
var animProps = {},
_ = this;
_.animateHeight();
if (_.options.rtl === true && _.options.vertical === false) {
targetLeft = -targetLeft;
}
if (_.transformsEnabled === false) {
if (_.options.vertical === false) {
_.$slideTrack.animate({
left: targetLeft
}, _.options.speed, _.options.easing, callback);
} else {
_.$slideTrack.animate({
top: targetLeft
}, _.options.speed, _.options.easing, callback);
}
} else {
if (_.cssTransitions === false) {
if (_.options.rtl === true) {
_.currentLeft = -(_.currentLeft);
}
$({
animStart: _.currentLeft
}).animate({
animStart: targetLeft
}, {
duration: _.options.speed,
easing: _.options.easing,
step: function(now) {
now = Math.ceil(now);
if (_.options.vertical === false) {
animProps[_.animType] = 'translate(' +
now + 'px, 0px)';
_.$slideTrack.css(animProps);
} else {
animProps[_.animType] = 'translate(0px,' +
now + 'px)';
_.$slideTrack.css(animProps);
}
},
complete: function() {
if (callback) {
callback.call();
}
}
});
} else {
_.applyTransition();
targetLeft = Math.ceil(targetLeft);
if (_.options.vertical === false) {
animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
} else {
animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
}
_.$slideTrack.css(animProps);
if (callback) {
setTimeout(function() {
_.disableTransition();
callback.call();
}, _.options.speed);
}
}
}
};
Slick.prototype.getNavTarget = function() {
var _ = this,
asNavFor = _.options.asNavFor;
if ( asNavFor && asNavFor !== null ) {
asNavFor = $(asNavFor).not(_.$slider);
}
return asNavFor;
};
Slick.prototype.asNavFor = function(index) {
var _ = this,
asNavFor = _.getNavTarget();
if ( asNavFor !== null && typeof asNavFor === 'object' ) {
asNavFor.each(function() {
var target = $(this).slick('getSlick');
if(!target.unslicked) {
target.slideHandler(index, true);
}
});
}
};
Slick.prototype.applyTransition = function(slide) {
var _ = this,
transition = {};
if (_.options.fade === false) {
transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
} else {
transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
}
if (_.options.fade === false) {
_.$slideTrack.css(transition);
} else {
_.$slides.eq(slide).css(transition);
}
};
Slick.prototype.autoPlay = function() {
var _ = this;
_.autoPlayClear();
if ( _.slideCount > _.options.slidesToShow ) {
_.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed );
}
};
Slick.prototype.autoPlayClear = function() {
var _ = this;
if (_.autoPlayTimer) {
clearInterval(_.autoPlayTimer);
}
};
Slick.prototype.autoPlayIterator = function() {
var _ = this,
slideTo = _.currentSlide + _.options.slidesToScroll;
if ( !_.paused && !_.interrupted && !_.focussed ) {
if ( _.options.infinite === false ) {
if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) {
_.direction = 0;
}
else if ( _.direction === 0 ) {
slideTo = _.currentSlide - _.options.slidesToScroll;
if ( _.currentSlide - 1 === 0 ) {
_.direction = 1;
}
}
}
_.slideHandler( slideTo );
}
};
Slick.prototype.buildArrows = function() {
var _ = this;
if (_.options.arrows === true ) {
_.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
_.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');
if( _.slideCount > _.options.slidesToShow ) {
_.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
_.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
if (_.htmlExpr.test(_.options.prevArrow)) {
_.$prevArrow.prependTo(_.options.appendArrows);
}
if (_.htmlExpr.test(_.options.nextArrow)) {
_.$nextArrow.appendTo(_.options.appendArrows);
}
if (_.options.infinite !== true) {
_.$prevArrow
.addClass('slick-disabled')
.attr('aria-disabled', 'true');
}
} else {
_.$prevArrow.add( _.$nextArrow )
.addClass('slick-hidden')
.attr({
'aria-disabled': 'true',
'tabindex': '-1'
});
}
}
};
Slick.prototype.buildDots = function() {
var _ = this,
i, dot;
if (_.options.dots === true) {
_.$slider.addClass('slick-dotted');
dot = $('').addClass(_.options.dotsClass);
for (i = 0; i <= _.getDotCount(); i += 1) {
dot.append($('').append(_.options.customPaging.call(this, _, i)));
}
_.$dots = dot.appendTo(_.options.appendDots);
_.$dots.find('li').first().addClass('slick-active');
}
};
Slick.prototype.buildOut = function() {
var _ = this;
_.$slides =
_.$slider
.children( _.options.slide + ':not(.slick-cloned)')
.addClass('slick-slide');
_.slideCount = _.$slides.length;
_.$slides.each(function(index, element) {
$(element)
.attr('data-slick-index', index)
.data('originalStyling', $(element).attr('style') || '');
});
_.$slider.addClass('slick-slider');
_.$slideTrack = (_.slideCount === 0) ?
$('').appendTo(_.$slider) :
_.$slides.wrapAll('').parent();
_.$list = _.$slideTrack.wrap(
'').parent();
_.$slideTrack.css('opacity', 0);
if (_.options.centerMode === true || _.options.swipeToSlide === true) {
_.options.slidesToScroll = 1;
}
$('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
_.setupInfinite();
_.buildArrows();
_.buildDots();
_.updateDots();
_.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
if (_.options.draggable === true) {
_.$list.addClass('draggable');
}
};
Slick.prototype.buildRows = function() {
var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;
newSlides = document.createDocumentFragment();
originalSlides = _.$slider.children();
if(_.options.rows > 1) {
slidesPerSection = _.options.slidesPerRow * _.options.rows;
numOfSlides = Math.ceil(
originalSlides.length / slidesPerSection
);
for(a = 0; a < numOfSlides; a++){
var slide = document.createElement('div');
for(b = 0; b < _.options.rows; b++) {
var row = document.createElement('div');
for(c = 0; c < _.options.slidesPerRow; c++) {
var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
if (originalSlides.get(target)) {
row.appendChild(originalSlides.get(target));
}
}
slide.appendChild(row);
}
newSlides.appendChild(slide);
}
_.$slider.empty().append(newSlides);
_.$slider.children().children().children()
.css({
'width':(100 / _.options.slidesPerRow) + '%',
'display': 'inline-block'
});
}
};
Slick.prototype.checkResponsive = function(initial, forceUpdate) {
var _ = this,
breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
var sliderWidth = _.$slider.width();
var windowWidth = window.innerWidth || $(window).width();
if (_.respondTo === 'window') {
respondToWidth = windowWidth;
} else if (_.respondTo === 'slider') {
respondToWidth = sliderWidth;
} else if (_.respondTo === 'min') {
respondToWidth = Math.min(windowWidth, sliderWidth);
}
if ( _.options.responsive &&
_.options.responsive.length &&
_.options.responsive !== null) {
targetBreakpoint = null;
for (breakpoint in _.breakpoints) {
if (_.breakpoints.hasOwnProperty(breakpoint)) {
if (_.originalSettings.mobileFirst === false) {
if (respondToWidth < _.breakpoints[breakpoint]) {
targetBreakpoint = _.breakpoints[breakpoint];
}
} else {
if (respondToWidth > _.breakpoints[breakpoint]) {
targetBreakpoint = _.breakpoints[breakpoint];
}
}
}
}
if (targetBreakpoint !== null) {
if (_.activeBreakpoint !== null) {
if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
_.activeBreakpoint =
targetBreakpoint;
if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
_.unslick(targetBreakpoint);
} else {
_.options = $.extend({}, _.originalSettings,
_.breakpointSettings[
targetBreakpoint]);
if (initial === true) {
_.currentSlide = _.options.initialSlide;
}
_.refresh(initial);
}
triggerBreakpoint = targetBreakpoint;
}
} else {
_.activeBreakpoint = targetBreakpoint;
if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
_.unslick(targetBreakpoint);
} else {
_.options = $.extend({}, _.originalSettings,
_.breakpointSettings[
targetBreakpoint]);
if (initial === true) {
_.currentSlide = _.options.initialSlide;
}
_.refresh(initial);
}
triggerBreakpoint = targetBreakpoint;
}
} else {
if (_.activeBreakpoint !== null) {
_.activeBreakpoint = null;
_.options = _.originalSettings;
if (initial === true) {
_.currentSlide = _.options.initialSlide;
}
_.refresh(initial);
triggerBreakpoint = targetBreakpoint;
}
}
// only trigger breakpoints during an actual break. not on initialize.
if( !initial && triggerBreakpoint !== false ) {
_.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
}
}
};
Slick.prototype.changeSlide = function(event, dontAnimate) {
var _ = this,
$target = $(event.currentTarget),
indexOffset, slideOffset, unevenOffset;
// If target is a link, prevent default action.
if($target.is('a')) {
event.preventDefault();
}
// If target is not the element (ie: a child), find the .
if(!$target.is('li')) {
$target = $target.closest('li');
}
unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
switch (event.data.message) {
case 'previous':
slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
if (_.slideCount > _.options.slidesToShow) {
_.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
}
break;
case 'next':
slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
if (_.slideCount > _.options.slidesToShow) {
_.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
}
break;
case 'index':
var index = event.data.index === 0 ? 0 :
event.data.index || $target.index() * _.options.slidesToScroll;
_.slideHandler(_.checkNavigable(index), false, dontAnimate);
$target.children().trigger('focus');
break;
default:
return;
}
};
Slick.prototype.checkNavigable = function(index) {
var _ = this,
navigables, prevNavigable;
navigables = _.getNavigableIndexes();
prevNavigable = 0;
if (index > navigables[navigables.length - 1]) {
index = navigables[navigables.length - 1];
} else {
for (var n in navigables) {
if (index < navigables[n]) {
index = prevNavigable;
break;
}
prevNavigable = navigables[n];
}
}
return index;
};
Slick.prototype.cleanUpEvents = function() {
var _ = this;
if (_.options.dots && _.$dots !== null) {
$('li', _.$dots)
.off('click.slick', _.changeSlide)
.off('mouseenter.slick', $.proxy(_.interrupt, _, true))
.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
if (_.options.accessibility === true) {
_.$dots.off('keydown.slick', _.keyHandler);
}
}
_.$slider.off('focus.slick blur.slick');
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
_.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
if (_.options.accessibility === true) {
_.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler);
_.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler);
}
}
_.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
_.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
_.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
_.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);
_.$list.off('click.slick', _.clickHandler);
$(document).off(_.visibilityChange, _.visibility);
_.cleanUpSlideEvents();
if (_.options.accessibility === true) {
_.$list.off('keydown.slick', _.keyHandler);
}
if (_.options.focusOnSelect === true) {
$(_.$slideTrack).children().off('click.slick', _.selectHandler);
}
$(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);
$(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
$('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);
$(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
};
Slick.prototype.cleanUpSlideEvents = function() {
var _ = this;
_.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));
_.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
};
Slick.prototype.cleanUpRows = function() {
var _ = this, originalSlides;
if(_.options.rows > 1) {
originalSlides = _.$slides.children().children();
originalSlides.removeAttr('style');
_.$slider.empty().append(originalSlides);
}
};
Slick.prototype.clickHandler = function(event) {
var _ = this;
if (_.shouldClick === false) {
event.stopImmediatePropagation();
event.stopPropagation();
event.preventDefault();
}
};
Slick.prototype.destroy = function(refresh) {
var _ = this;
_.autoPlayClear();
_.touchObject = {};
_.cleanUpEvents();
$('.slick-cloned', _.$slider).detach();
if (_.$dots) {
_.$dots.remove();
}
if ( _.$prevArrow && _.$prevArrow.length ) {
_.$prevArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css('display','');
if ( _.htmlExpr.test( _.options.prevArrow )) {
_.$prevArrow.remove();
}
}
if ( _.$nextArrow && _.$nextArrow.length ) {
_.$nextArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css('display','');
if ( _.htmlExpr.test( _.options.nextArrow )) {
_.$nextArrow.remove();
}
}
if (_.$slides) {
_.$slides
.removeClass('slick-slide slick-active slick-center slick-visible slick-current')
.removeAttr('aria-hidden')
.removeAttr('data-slick-index')
.each(function(){
$(this).attr('style', $(this).data('originalStyling'));
});
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.detach();
_.$list.detach();
_.$slider.append(_.$slides);
}
_.cleanUpRows();
_.$slider.removeClass('slick-slider');
_.$slider.removeClass('slick-initialized');
_.$slider.removeClass('slick-dotted');
_.unslicked = true;
if(!refresh) {
_.$slider.trigger('destroy', [_]);
}
};
Slick.prototype.disableTransition = function(slide) {
var _ = this,
transition = {};
transition[_.transitionType] = '';
if (_.options.fade === false) {
_.$slideTrack.css(transition);
} else {
_.$slides.eq(slide).css(transition);
}
};
Slick.prototype.fadeSlide = function(slideIndex, callback) {
var _ = this;
if (_.cssTransitions === false) {
_.$slides.eq(slideIndex).css({
zIndex: _.options.zIndex
});
_.$slides.eq(slideIndex).animate({
opacity: 1
}, _.options.speed, _.options.easing, callback);
} else {
_.applyTransition(slideIndex);
_.$slides.eq(slideIndex).css({
opacity: 1,
zIndex: _.options.zIndex
});
if (callback) {
setTimeout(function() {
_.disableTransition(slideIndex);
callback.call();
}, _.options.speed);
}
}
};
Slick.prototype.fadeSlideOut = function(slideIndex) {
var _ = this;
if (_.cssTransitions === false) {
_.$slides.eq(slideIndex).animate({
opacity: 0,
zIndex: _.options.zIndex - 2
}, _.options.speed, _.options.easing);
} else {
_.applyTransition(slideIndex);
_.$slides.eq(slideIndex).css({
opacity: 0,
zIndex: _.options.zIndex - 2
});
}
};
Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
var _ = this;
if (filter !== null) {
_.$slidesCache = _.$slides;
_.unload();
_.$slideTrack.children(this.options.slide).detach();
_.$slidesCache.filter(filter).appendTo(_.$slideTrack);
_.reinit();
}
};
Slick.prototype.focusHandler = function() {
var _ = this;
_.$slider
.off('focus.slick blur.slick')
.on('focus.slick blur.slick', '*', function(event) {
event.stopImmediatePropagation();
var $sf = $(this);
setTimeout(function() {
if( _.options.pauseOnFocus ) {
_.focussed = $sf.is(':focus');
_.autoPlay();
}
}, 0);
});
};
Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
var _ = this;
return _.currentSlide;
};
Slick.prototype.getDotCount = function() {
var _ = this;
var breakPoint = 0;
var counter = 0;
var pagerQty = 0;
if (_.options.infinite === true) {
if (_.slideCount <= _.options.slidesToShow) {
++pagerQty;
} else {
while (breakPoint < _.slideCount) {
++pagerQty;
breakPoint = counter + _.options.slidesToScroll;
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
}
}
} else if (_.options.centerMode === true) {
pagerQty = _.slideCount;
} else if(!_.options.asNavFor) {
pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
}else {
while (breakPoint < _.slideCount) {
++pagerQty;
breakPoint = counter + _.options.slidesToScroll;
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
}
}
return pagerQty - 1;
};
Slick.prototype.getLeft = function(slideIndex) {
var _ = this,
targetLeft,
verticalHeight,
verticalOffset = 0,
targetSlide,
coef;
_.slideOffset = 0;
verticalHeight = _.$slides.first().outerHeight(true);
if (_.options.infinite === true) {
if (_.slideCount > _.options.slidesToShow) {
_.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
coef = -1
if (_.options.vertical === true && _.options.centerMode === true) {
if (_.options.slidesToShow === 2) {
coef = -1.5;
} else if (_.options.slidesToShow === 1) {
coef = -2
}
}
verticalOffset = (verticalHeight * _.options.slidesToShow) * coef;
}
if (_.slideCount % _.options.slidesToScroll !== 0) {
if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
if (slideIndex > _.slideCount) {
_.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
} else {
_.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
}
}
}
} else {
if (slideIndex + _.options.slidesToShow > _.slideCount) {
_.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
}
}
if (_.slideCount <= _.options.slidesToShow) {
_.slideOffset = 0;
verticalOffset = 0;
}
if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) {
_.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2);
} else if (_.options.centerMode === true && _.options.infinite === true) {
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
} else if (_.options.centerMode === true) {
_.slideOffset = 0;
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
}
if (_.options.vertical === false) {
targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
} else {
targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
}
if (_.options.variableWidth === true) {
if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
} else {
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
}
if (_.options.rtl === true) {
if (targetSlide[0]) {
targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
} else {
targetLeft = 0;
}
} else {
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
}
if (_.options.centerMode === true) {
if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
} else {
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
}
if (_.options.rtl === true) {
if (targetSlide[0]) {
targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
} else {
targetLeft = 0;
}
} else {
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
}
targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
}
}
return targetLeft;
};
Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
var _ = this;
return _.options[option];
};
Slick.prototype.getNavigableIndexes = function() {
var _ = this,
breakPoint = 0,
counter = 0,
indexes = [],
max;
if (_.options.infinite === false) {
max = _.slideCount;
} else {
breakPoint = _.options.slidesToScroll * -1;
counter = _.options.slidesToScroll * -1;
max = _.slideCount * 2;
}
while (breakPoint < max) {
indexes.push(breakPoint);
breakPoint = counter + _.options.slidesToScroll;
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
}
return indexes;
};
Slick.prototype.getSlick = function() {
return this;
};
Slick.prototype.getSlideCount = function() {
var _ = this,
slidesTraversed, swipedSlide, centerOffset;
centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
if (_.options.swipeToSlide === true) {
_.$slideTrack.find('.slick-slide').each(function(index, slide) {
if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
swipedSlide = slide;
return false;
}
});
slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
return slidesTraversed;
} else {
return _.options.slidesToScroll;
}
};
Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
var _ = this;
_.changeSlide({
data: {
message: 'index',
index: parseInt(slide)
}
}, dontAnimate);
};
Slick.prototype.init = function(creation) {
var _ = this;
if (!$(_.$slider).hasClass('slick-initialized')) {
$(_.$slider).addClass('slick-initialized');
_.buildRows();
_.buildOut();
_.setProps();
_.startLoad();
_.loadSlider();
_.initializeEvents();
_.updateArrows();
_.updateDots();
_.checkResponsive(true);
_.focusHandler();
}
if (creation) {
_.$slider.trigger('init', [_]);
}
if (_.options.accessibility === true) {
_.initADA();
}
if ( _.options.autoplay ) {
_.paused = false;
_.autoPlay();
}
};
Slick.prototype.initADA = function() {
var _ = this,
numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow),
tabControlIndexes = _.getNavigableIndexes().filter(function(val) {
return (val >= 0) && (val < _.slideCount);
});
_.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
'aria-hidden': 'true',
'tabindex': '-1'
}).find('a, input, button, select').attr({
'tabindex': '-1'
});
if (_.$dots !== null) {
_.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
var slideControlIndex = tabControlIndexes.indexOf(i);
$(this).attr({
'role': 'tabpanel',
'id': 'slick-slide' + _.instanceUid + i,
'tabindex': -1
});
if (slideControlIndex !== -1) {
$(this).attr({
'aria-describedby': 'slick-slide-control' + _.instanceUid + slideControlIndex
});
}
});
_.$dots.attr('role', 'tablist').find('li').each(function(i) {
var mappedSlideIndex = tabControlIndexes[i];
$(this).attr({
'role': 'presentation'
});
$(this).find('button').first().attr({
'role': 'tab',
'id': 'slick-slide-control' + _.instanceUid + i,
'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex,
'aria-label': (i + 1) + ' of ' + numDotGroups,
'aria-selected': null,
'tabindex': '-1'
});
}).eq(_.currentSlide).find('button').attr({
'aria-selected': 'true',
'tabindex': '0'
}).end();
}
for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) {
_.$slides.eq(i).attr('tabindex', 0);
}
_.activateADA();
};
Slick.prototype.initArrowEvents = function() {
var _ = this;
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow
.off('click.slick')
.on('click.slick', {
message: 'previous'
}, _.changeSlide);
_.$nextArrow
.off('click.slick')
.on('click.slick', {
message: 'next'
}, _.changeSlide);
if (_.options.accessibility === true) {
_.$prevArrow.on('keydown.slick', _.keyHandler);
_.$nextArrow.on('keydown.slick', _.keyHandler);
}
}
};
Slick.prototype.initDotEvents = function() {
var _ = this;
if (_.options.dots === true) {
$('li', _.$dots).on('click.slick', {
message: 'index'
}, _.changeSlide);
/*
$('li', _.$dots).on('mouseenter.slick', {
message: 'index'
}, _.changeSlide);
*/
if (_.options.accessibility === true) {
_.$dots.on('keydown.slick', _.keyHandler);
}
}
if ( _.options.dots === true && _.options.pauseOnDotsHover === true ) {
$('li', _.$dots)
.on('mouseenter.slick', $.proxy(_.interrupt, _, true))
.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
}
};
Slick.prototype.initSlideEvents = function() {
var _ = this;
if ( _.options.pauseOnHover ) {
_.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
_.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
}
};
Slick.prototype.initializeEvents = function() {
var _ = this;
_.initArrowEvents();
_.initDotEvents();
_.initSlideEvents();
_.$list.on('touchstart.slick mousedown.slick', {
action: 'start'
}, _.swipeHandler);
_.$list.on('touchmove.slick mousemove.slick', {
action: 'move'
}, _.swipeHandler);
_.$list.on('touchend.slick mouseup.slick', {
action: 'end'
}, _.swipeHandler);
_.$list.on('touchcancel.slick mouseleave.slick', {
action: 'end'
}, _.swipeHandler);
_.$list.on('click.slick', _.clickHandler);
$(document).on(_.visibilityChange, $.proxy(_.visibility, _));
if (_.options.accessibility === true) {
_.$list.on('keydown.slick', _.keyHandler);
}
if (_.options.focusOnSelect === true) {
$(_.$slideTrack).children().on('click.slick', _.selectHandler);
}
$(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
$(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
$('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
$(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
$(_.setPosition);
};
Slick.prototype.initUI = function() {
var _ = this;
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow.show();
_.$nextArrow.show();
}
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
_.$dots.show();
}
};
Slick.prototype.keyHandler = function(event) {
var _ = this;
//Dont slide if the cursor is inside the form fields and arrow keys are pressed
if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
if (event.keyCode === 37 && _.options.accessibility === true) {
_.changeSlide({
data: {
message: _.options.rtl === true ? 'next' : 'previous'
}
});
} else if (event.keyCode === 39 && _.options.accessibility === true) {
_.changeSlide({
data: {
message: _.options.rtl === true ? 'previous' : 'next'
}
});
}
}
};
Slick.prototype.lazyLoad = function() {
var _ = this,
loadRange, cloneRange, rangeStart, rangeEnd;
function loadImages(imagesScope) {
$('img[data-lazy]', imagesScope).each(function() {
var image = $(this),
imageSource = $(this).attr('data-lazy'),
imageSrcSet = $(this).attr('data-srcset'),
imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'),
imageToLoad = document.createElement('img');
imageToLoad.onload = function() {
image
.animate({ opacity: 0 }, 100, function() {
if (imageSrcSet) {
image
.attr('srcset', imageSrcSet );
if (imageSizes) {
image
.attr('sizes', imageSizes );
}
}
image
.attr('src', imageSource)
.animate({ opacity: 1 }, 200, function() {
image
.removeAttr('data-lazy data-srcset data-sizes')
.removeClass('slick-loading');
});
_.$slider.trigger('lazyLoaded', [_, image, imageSource]);
});
};
imageToLoad.onerror = function() {
image
.removeAttr( 'data-lazy' )
.removeClass( 'slick-loading' )
.addClass( 'slick-lazyload-error' );
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
};
imageToLoad.src = imageSource;
});
}
if (_.options.centerMode === true) {
if (_.options.infinite === true) {
rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
rangeEnd = rangeStart + _.options.slidesToShow + 2;
} else {
rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
}
} else {
rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow);
if (_.options.fade === true) {
if (rangeStart > 0) rangeStart--;
if (rangeEnd <= _.slideCount) rangeEnd++;
}
}
loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
if (_.options.lazyLoad === 'anticipated') {
var prevSlide = rangeStart - 1,
nextSlide = rangeEnd,
$slides = _.$slider.find('.slick-slide');
for (var i = 0; i < _.options.slidesToScroll; i++) {
if (prevSlide < 0) prevSlide = _.slideCount - 1;
loadRange = loadRange.add($slides.eq(prevSlide));
loadRange = loadRange.add($slides.eq(nextSlide));
prevSlide--;
nextSlide++;
}
}
loadImages(loadRange);
if (_.slideCount <= _.options.slidesToShow) {
cloneRange = _.$slider.find('.slick-slide');
loadImages(cloneRange);
} else
if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
loadImages(cloneRange);
} else if (_.currentSlide === 0) {
cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
loadImages(cloneRange);
}
};
Slick.prototype.loadSlider = function() {
var _ = this;
_.setPosition();
_.$slideTrack.css({
opacity: 1
});
_.$slider.removeClass('slick-loading');
_.initUI();
if (_.options.lazyLoad === 'progressive') {
_.progressiveLazyLoad();
}
};
Slick.prototype.next = Slick.prototype.slickNext = function() {
var _ = this;
_.changeSlide({
data: {
message: 'next'
}
});
};
Slick.prototype.orientationChange = function() {
var _ = this;
_.checkResponsive();
_.setPosition();
};
Slick.prototype.pause = Slick.prototype.slickPause = function() {
var _ = this;
_.autoPlayClear();
_.paused = true;
};
Slick.prototype.play = Slick.prototype.slickPlay = function() {
var _ = this;
_.autoPlay();
_.options.autoplay = true;
_.paused = false;
_.focussed = false;
_.interrupted = false;
};
Slick.prototype.postSlide = function(index) {
var _ = this;
if( !_.unslicked ) {
_.$slider.trigger('afterChange', [_, index]);
_.animating = false;
if (_.slideCount > _.options.slidesToShow) {
_.setPosition();
}
_.swipeLeft = null;
if ( _.options.autoplay ) {
_.autoPlay();
}
if (_.options.accessibility === true) {
_.initADA();
if (_.options.focusOnChange) {
var $currentSlide = $(_.$slides.get(_.currentSlide));
$currentSlide.attr('tabindex', 0).focus();
}
}
}
};
Slick.prototype.prev = Slick.prototype.slickPrev = function() {
var _ = this;
_.changeSlide({
data: {
message: 'previous'
}
});
};
Slick.prototype.preventDefault = function(event) {
event.preventDefault();
};
Slick.prototype.progressiveLazyLoad = function( tryCount ) {
tryCount = tryCount || 1;
var _ = this,
$imgsToLoad = $( 'img[data-lazy]', _.$slider ),
image,
imageSource,
imageSrcSet,
imageSizes,
imageToLoad;
if ( $imgsToLoad.length ) {
image = $imgsToLoad.first();
imageSource = image.attr('data-lazy');
imageSrcSet = image.attr('data-srcset');
imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes');
imageToLoad = document.createElement('img');
imageToLoad.onload = function() {
if (imageSrcSet) {
image
.attr('srcset', imageSrcSet );
if (imageSizes) {
image
.attr('sizes', imageSizes );
}
}
image
.attr( 'src', imageSource )
.removeAttr('data-lazy data-srcset data-sizes')
.removeClass('slick-loading');
if ( _.options.adaptiveHeight === true ) {
_.setPosition();
}
_.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);
_.progressiveLazyLoad();
};
imageToLoad.onerror = function() {
if ( tryCount < 3 ) {
/**
* try to load the image 3 times,
* leave a slight delay so we don't get
* servers blocking the request.
*/
setTimeout( function() {
_.progressiveLazyLoad( tryCount + 1 );
}, 500 );
} else {
image
.removeAttr( 'data-lazy' )
.removeClass( 'slick-loading' )
.addClass( 'slick-lazyload-error' );
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
_.progressiveLazyLoad();
}
};
imageToLoad.src = imageSource;
} else {
_.$slider.trigger('allImagesLoaded', [ _ ]);
}
};
Slick.prototype.refresh = function( initializing ) {
var _ = this, currentSlide, lastVisibleIndex;
lastVisibleIndex = _.slideCount - _.options.slidesToShow;
// in non-infinite sliders, we don't want to go past the
// last visible index.
if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) {
_.currentSlide = lastVisibleIndex;
}
// if less slides than to show, go to start.
if ( _.slideCount <= _.options.slidesToShow ) {
_.currentSlide = 0;
}
currentSlide = _.currentSlide;
_.destroy(true);
$.extend(_, _.initials, { currentSlide: currentSlide });
_.init();
if( !initializing ) {
_.changeSlide({
data: {
message: 'index',
index: currentSlide
}
}, false);
}
};
Slick.prototype.registerBreakpoints = function() {
var _ = this, breakpoint, currentBreakpoint, l,
responsiveSettings = _.options.responsive || null;
if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) {
_.respondTo = _.options.respondTo || 'window';
for ( breakpoint in responsiveSettings ) {
l = _.breakpoints.length-1;
if (responsiveSettings.hasOwnProperty(breakpoint)) {
currentBreakpoint = responsiveSettings[breakpoint].breakpoint;
// loop through the breakpoints and cut out any existing
// ones with the same breakpoint number, we don't want dupes.
while( l >= 0 ) {
if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {
_.breakpoints.splice(l,1);
}
l--;
}
_.breakpoints.push(currentBreakpoint);
_.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;
}
}
_.breakpoints.sort(function(a, b) {
return ( _.options.mobileFirst ) ? a-b : b-a;
});
}
};
Slick.prototype.reinit = function() {
var _ = this;
_.$slides =
_.$slideTrack
.children(_.options.slide)
.addClass('slick-slide');
_.slideCount = _.$slides.length;
if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
_.currentSlide = _.currentSlide - _.options.slidesToScroll;
}
if (_.slideCount <= _.options.slidesToShow) {
_.currentSlide = 0;
}
_.registerBreakpoints();
_.setProps();
_.setupInfinite();
_.buildArrows();
_.updateArrows();
_.initArrowEvents();
_.buildDots();
_.updateDots();
_.initDotEvents();
_.cleanUpSlideEvents();
_.initSlideEvents();
_.checkResponsive(false, true);
if (_.options.focusOnSelect === true) {
$(_.$slideTrack).children().on('click.slick', _.selectHandler);
$(_.$slideTrack).children().on('mouserover.slick', _.selectHandler);
}
_.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
_.setPosition();
_.focusHandler();
_.paused = !_.options.autoplay;
_.autoPlay();
_.$slider.trigger('reInit', [_]);
};
Slick.prototype.resize = function() {
var _ = this;
if ($(window).width() !== _.windowWidth) {
clearTimeout(_.windowDelay);
_.windowDelay = window.setTimeout(function() {
_.windowWidth = $(window).width();
_.checkResponsive();
if( !_.unslicked ) { _.setPosition(); }
}, 50);
}
};
Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
var _ = this;
if (typeof(index) === 'boolean') {
removeBefore = index;
index = removeBefore === true ? 0 : _.slideCount - 1;
} else {
index = removeBefore === true ? --index : index;
}
if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
return false;
}
_.unload();
if (removeAll === true) {
_.$slideTrack.children().remove();
} else {
_.$slideTrack.children(this.options.slide).eq(index).remove();
}
_.$slides = _.$slideTrack.children(this.options.slide);
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.append(_.$slides);
_.$slidesCache = _.$slides;
_.reinit();
};
Slick.prototype.setCSS = function(position) {
var _ = this,
positionProps = {},
x, y;
if (_.options.rtl === true) {
position = -position;
}
x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
positionProps[_.positionProp] = position;
if (_.transformsEnabled === false) {
_.$slideTrack.css(positionProps);
} else {
positionProps = {};
if (_.cssTransitions === false) {
positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
_.$slideTrack.css(positionProps);
} else {
positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
_.$slideTrack.css(positionProps);
}
}
};
Slick.prototype.setDimensions = function() {
var _ = this;
if (_.options.vertical === false) {
if (_.options.centerMode === true) {
_.$list.css({
padding: ('0px ' + _.options.centerPadding)
});
}
} else {
_.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
if (_.options.centerMode === true) {
_.$list.css({
padding: (_.options.centerPadding + ' 0px')
});
}
}
_.listWidth = _.$list.width();
_.listHeight = _.$list.height();
if (_.options.vertical === false && _.options.variableWidth === false) {
_.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
_.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
} else if (_.options.variableWidth === true) {
_.$slideTrack.width(5000 * _.slideCount);
} else {
_.slideWidth = Math.ceil(_.listWidth);
_.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
}
var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
};
Slick.prototype.setFade = function() {
var _ = this,
targetLeft;
_.$slides.each(function(index, element) {
targetLeft = (_.slideWidth * index) * -1;
if (_.options.rtl === true) {
$(element).css({
position: 'relative',
right: targetLeft,
top: 0,
zIndex: _.options.zIndex - 2,
opacity: 0
});
} else {
$(element).css({
position: 'relative',
left: targetLeft,
top: 0,
zIndex: _.options.zIndex - 2,
opacity: 0
});
}
});
_.$slides.eq(_.currentSlide).css({
zIndex: _.options.zIndex - 1,
opacity: 1
});
};
Slick.prototype.setHeight = function() {
var _ = this;
if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
_.$list.css('height', targetHeight);
}
};
Slick.prototype.setOption =
Slick.prototype.slickSetOption = function() {
/**
* accepts arguments in format of:
*
* - for changing a single option's value:
* .slick("setOption", option, value, refresh )
*
* - for changing a set of responsive options:
* .slick("setOption", 'responsive', [{}, ...], refresh )
*
* - for updating multiple values at once (not responsive)
* .slick("setOption", { 'option': value, ... }, refresh )
*/
var _ = this, l, item, option, value, refresh = false, type;
if( $.type( arguments[0] ) === 'object' ) {
option = arguments[0];
refresh = arguments[1];
type = 'multiple';
} else if ( $.type( arguments[0] ) === 'string' ) {
option = arguments[0];
value = arguments[1];
refresh = arguments[2];
if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {
type = 'responsive';
} else if ( typeof arguments[1] !== 'undefined' ) {
type = 'single';
}
}
if ( type === 'single' ) {
_.options[option] = value;
} else if ( type === 'multiple' ) {
$.each( option , function( opt, val ) {
_.options[opt] = val;
});
} else if ( type === 'responsive' ) {
for ( item in value ) {
if( $.type( _.options.responsive ) !== 'array' ) {
_.options.responsive = [ value[item] ];
} else {
l = _.options.responsive.length-1;
// loop through the responsive object and splice out duplicates.
while( l >= 0 ) {
if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
_.options.responsive.splice(l,1);
}
l--;
}
_.options.responsive.push( value[item] );
}
}
}
if ( refresh ) {
_.unload();
_.reinit();
}
};
Slick.prototype.setPosition = function() {
var _ = this;
_.setDimensions();
_.setHeight();
if (_.options.fade === false) {
_.setCSS(_.getLeft(_.currentSlide));
} else {
_.setFade();
}
_.$slider.trigger('setPosition', [_]);
};
Slick.prototype.setProps = function() {
var _ = this,
bodyStyle = document.body.style;
_.positionProp = _.options.vertical === true ? 'top' : 'left';
if (_.positionProp === 'top') {
_.$slider.addClass('slick-vertical');
} else {
_.$slider.removeClass('slick-vertical');
}
if (bodyStyle.WebkitTransition !== undefined ||
bodyStyle.MozTransition !== undefined ||
bodyStyle.msTransition !== undefined) {
if (_.options.useCSS === true) {
_.cssTransitions = true;
}
}
if ( _.options.fade ) {
if ( typeof _.options.zIndex === 'number' ) {
if( _.options.zIndex < 3 ) {
_.options.zIndex = 3;
}
} else {
_.options.zIndex = _.defaults.zIndex;
}
}
if (bodyStyle.OTransform !== undefined) {
_.animType = 'OTransform';
_.transformType = '-o-transform';
_.transitionType = 'OTransition';
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
}
if (bodyStyle.MozTransform !== undefined) {
_.animType = 'MozTransform';
_.transformType = '-moz-transform';
_.transitionType = 'MozTransition';
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
}
if (bodyStyle.webkitTransform !== undefined) {
_.animType = 'webkitTransform';
_.transformType = '-webkit-transform';
_.transitionType = 'webkitTransition';
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
}
if (bodyStyle.msTransform !== undefined) {
_.animType = 'msTransform';
_.transformType = '-ms-transform';
_.transitionType = 'msTransition';
if (bodyStyle.msTransform === undefined) _.animType = false;
}
if (bodyStyle.transform !== undefined && _.animType !== false) {
_.animType = 'transform';
_.transformType = 'transform';
_.transitionType = 'transition';
}
_.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);
};
Slick.prototype.setSlideClasses = function(index) {
var _ = this,
centerOffset, allSlides, indexOffset, remainder;
allSlides = _.$slider
.find('.slick-slide')
.removeClass('slick-active slick-center slick-current')
.attr('aria-hidden', 'true');
_.$slides
.eq(index)
.addClass('slick-current');
if (_.options.centerMode === true) {
var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0;
centerOffset = Math.floor(_.options.slidesToShow / 2);
if (_.options.infinite === true) {
if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
_.$slides
.slice(index - centerOffset + evenCoef, index + centerOffset + 1)
.addClass('slick-active')
.attr('aria-hidden', 'false');
} else {
indexOffset = _.options.slidesToShow + index;
allSlides
.slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2)
.addClass('slick-active')
.attr('aria-hidden', 'false');
}
if (index === 0) {
allSlides
.eq(allSlides.length - 1 - _.options.slidesToShow)
.addClass('slick-center');
} else if (index === _.slideCount - 1) {
allSlides
.eq(_.options.slidesToShow)
.addClass('slick-center');
}
}
_.$slides
.eq(index)
.addClass('slick-center');
} else {
if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
_.$slides
.slice(index, index + _.options.slidesToShow)
.addClass('slick-active')
.attr('aria-hidden', 'false');
} else if (allSlides.length <= _.options.slidesToShow) {
allSlides
.addClass('slick-active')
.attr('aria-hidden', 'false');
} else {
remainder = _.slideCount % _.options.slidesToShow;
indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
allSlides
.slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
.addClass('slick-active')
.attr('aria-hidden', 'false');
} else {
allSlides
.slice(indexOffset, indexOffset + _.options.slidesToShow)
.addClass('slick-active')
.attr('aria-hidden', 'false');
}
}
}
if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') {
_.lazyLoad();
}
};
Slick.prototype.setupInfinite = function() {
var _ = this,
i, slideIndex, infiniteCount;
if (_.options.fade === true) {
_.options.centerMode = false;
}
if (_.options.infinite === true && _.options.fade === false) {
slideIndex = null;
if (_.slideCount > _.options.slidesToShow) {
if (_.options.centerMode === true) {
infiniteCount = _.options.slidesToShow + 1;
} else {
infiniteCount = _.options.slidesToShow;
}
for (i = _.slideCount; i > (_.slideCount -
infiniteCount); i -= 1) {
slideIndex = i - 1;
$(_.$slides[slideIndex]).clone(true).attr('id', '')
.attr('data-slick-index', slideIndex - _.slideCount)
.prependTo(_.$slideTrack).addClass('slick-cloned');
}
for (i = 0; i < infiniteCount + _.slideCount; i += 1) {
slideIndex = i;
$(_.$slides[slideIndex]).clone(true).attr('id', '')
.attr('data-slick-index', slideIndex + _.slideCount)
.appendTo(_.$slideTrack).addClass('slick-cloned');
}
_.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
$(this).attr('id', '');
});
}
}
};
Slick.prototype.interrupt = function( toggle ) {
var _ = this;
if( !toggle ) {
_.autoPlay();
}
_.interrupted = toggle;
};
Slick.prototype.selectHandler = function(event) {
var _ = this;
var targetElement =
$(event.target).is('.slick-slide') ?
$(event.target) :
$(event.target).parents('.slick-slide');
var index = parseInt(targetElement.attr('data-slick-index'));
if (!index) index = 0;
if (_.slideCount <= _.options.slidesToShow) {
_.slideHandler(index, false, true);
return;
}
_.slideHandler(index);
};
Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
_ = this, navTarget;
sync = sync || false;
if (_.animating === true && _.options.waitForAnimate === true) {
return;
}
if (_.options.fade === true && _.currentSlide === index) {
return;
}
if (sync === false) {
_.asNavFor(index);
}
targetSlide = index;
targetLeft = _.getLeft(targetSlide);
slideLeft = _.getLeft(_.currentSlide);
_.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
if (_.options.fade === false) {
targetSlide = _.currentSlide;
if (dontAnimate !== true) {
_.animateSlide(slideLeft, function() {
_.postSlide(targetSlide);
});
} else {
_.postSlide(targetSlide);
}
}
return;
} else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
if (_.options.fade === false) {
targetSlide = _.currentSlide;
if (dontAnimate !== true) {
_.animateSlide(slideLeft, function() {
_.postSlide(targetSlide);
});
} else {
_.postSlide(targetSlide);
}
}
return;
}
if ( _.options.autoplay ) {
clearInterval(_.autoPlayTimer);
}
if (targetSlide < 0) {
if (_.slideCount % _.options.slidesToScroll !== 0) {
animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
} else {
animSlide = _.slideCount + targetSlide;
}
} else if (targetSlide >= _.slideCount) {
if (_.slideCount % _.options.slidesToScroll !== 0) {
animSlide = 0;
} else {
animSlide = targetSlide - _.slideCount;
}
} else {
animSlide = targetSlide;
}
_.animating = true;
_.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);
oldSlide = _.currentSlide;
_.currentSlide = animSlide;
_.setSlideClasses(_.currentSlide);
if ( _.options.asNavFor ) {
navTarget = _.getNavTarget();
navTarget = navTarget.slick('getSlick');
if ( navTarget.slideCount <= navTarget.options.slidesToShow ) {
navTarget.setSlideClasses(_.currentSlide);
}
}
_.updateDots();
_.updateArrows();
if (_.options.fade === true) {
if (dontAnimate !== true) {
_.fadeSlideOut(oldSlide);
_.fadeSlide(animSlide, function() {
_.postSlide(animSlide);
});
} else {
_.postSlide(animSlide);
}
_.animateHeight();
return;
}
if (dontAnimate !== true) {
_.animateSlide(targetLeft, function() {
_.postSlide(animSlide);
});
} else {
_.postSlide(animSlide);
}
};
Slick.prototype.startLoad = function() {
var _ = this;
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow.hide();
_.$nextArrow.hide();
}
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
_.$dots.hide();
}
_.$slider.addClass('slick-loading');
};
Slick.prototype.swipeDirection = function() {
var xDist, yDist, r, swipeAngle, _ = this;
xDist = _.touchObject.startX - _.touchObject.curX;
yDist = _.touchObject.startY - _.touchObject.curY;
r = Math.atan2(yDist, xDist);
swipeAngle = Math.round(r * 180 / Math.PI);
if (swipeAngle < 0) {
swipeAngle = 360 - Math.abs(swipeAngle);
}
if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
return (_.options.rtl === false ? 'left' : 'right');
}
if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
return (_.options.rtl === false ? 'left' : 'right');
}
if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
return (_.options.rtl === false ? 'right' : 'left');
}
if (_.options.verticalSwiping === true) {
if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
return 'down';
} else {
return 'up';
}
}
return 'vertical';
};
Slick.prototype.swipeEnd = function(event) {
var _ = this,
slideCount,
direction;
_.dragging = false;
_.swiping = false;
if (_.scrolling) {
_.scrolling = false;
return false;
}
_.interrupted = false;
_.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true;
if ( _.touchObject.curX === undefined ) {
return false;
}
if ( _.touchObject.edgeHit === true ) {
_.$slider.trigger('edge', [_, _.swipeDirection() ]);
}
if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) {
direction = _.swipeDirection();
switch ( direction ) {
case 'left':
case 'down':
slideCount =
_.options.swipeToSlide ?
_.checkNavigable( _.currentSlide + _.getSlideCount() ) :
_.currentSlide + _.getSlideCount();
_.currentDirection = 0;
break;
case 'right':
case 'up':
slideCount =
_.options.swipeToSlide ?
_.checkNavigable( _.currentSlide - _.getSlideCount() ) :
_.currentSlide - _.getSlideCount();
_.currentDirection = 1;
break;
default:
}
if( direction != 'vertical' ) {
_.slideHandler( slideCount );
_.touchObject = {};
_.$slider.trigger('swipe', [_, direction ]);
}
} else {
if ( _.touchObject.startX !== _.touchObject.curX ) {
_.slideHandler( _.currentSlide );
_.touchObject = {};
}
}
};
Slick.prototype.swipeHandler = function(event) {
var _ = this;
if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
return;
} else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
return;
}
_.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
event.originalEvent.touches.length : 1;
_.touchObject.minSwipe = _.listWidth / _.options
.touchThreshold;
if (_.options.verticalSwiping === true) {
_.touchObject.minSwipe = _.listHeight / _.options
.touchThreshold;
}
switch (event.data.action) {
case 'start':
_.swipeStart(event);
break;
case 'move':
_.swipeMove(event);
break;
case 'end':
_.swipeEnd(event);
break;
}
};
Slick.prototype.swipeMove = function(event) {
var _ = this,
edgeWasHit = false,
curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength;
touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
if (!_.dragging || _.scrolling || touches && touches.length !== 1) {
return false;
}
curLeft = _.getLeft(_.currentSlide);
_.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
_.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
_.touchObject.swipeLength = Math.round(Math.sqrt(
Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
verticalSwipeLength = Math.round(Math.sqrt(
Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) {
_.scrolling = true;
return false;
}
if (_.options.verticalSwiping === true) {
_.touchObject.swipeLength = verticalSwipeLength;
}
swipeDirection = _.swipeDirection();
if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
_.swiping = true;
event.preventDefault();
}
positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
if (_.options.verticalSwiping === true) {
positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;
}
swipeLength = _.touchObject.swipeLength;
_.touchObject.edgeHit = false;
if (_.options.infinite === false) {
if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {
swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
_.touchObject.edgeHit = true;
}
}
if (_.options.vertical === false) {
_.swipeLeft = curLeft + swipeLength * positionOffset;
} else {
_.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
}
if (_.options.verticalSwiping === true) {
_.swipeLeft = curLeft + swipeLength * positionOffset;
}
if (_.options.fade === true || _.options.touchMove === false) {
return false;
}
if (_.animating === true) {
_.swipeLeft = null;
return false;
}
_.setCSS(_.swipeLeft);
};
Slick.prototype.swipeStart = function(event) {
var _ = this,
touches;
_.interrupted = true;
if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
_.touchObject = {};
return false;
}
if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
touches = event.originalEvent.touches[0];
}
_.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
_.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
_.dragging = true;
};
Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
var _ = this;
if (_.$slidesCache !== null) {
_.unload();
_.$slideTrack.children(this.options.slide).detach();
_.$slidesCache.appendTo(_.$slideTrack);
_.reinit();
}
};
Slick.prototype.unload = function() {
var _ = this;
$('.slick-cloned', _.$slider).remove();
if (_.$dots) {
_.$dots.remove();
}
if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
_.$prevArrow.remove();
}
if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
_.$nextArrow.remove();
}
_.$slides
.removeClass('slick-slide slick-active slick-visible slick-current')
.attr('aria-hidden', 'true')
.css('width', '');
};
Slick.prototype.unslick = function(fromBreakpoint) {
var _ = this;
_.$slider.trigger('unslick', [_, fromBreakpoint]);
_.destroy();
};
Slick.prototype.updateArrows = function() {
var _ = this,
centerOffset;
centerOffset = Math.floor(_.options.slidesToShow / 2);
if ( _.options.arrows === true &&
_.slideCount > _.options.slidesToShow &&
!_.options.infinite ) {
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
if (_.currentSlide === 0) {
_.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
} else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
} else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
}
}
};
Slick.prototype.updateDots = function() {
var _ = this;
if (_.$dots !== null) {
_.$dots
.find('li')
.removeClass('slick-active')
.end();
_.$dots
.find('li')
.eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
.addClass('slick-active');
}
};
Slick.prototype.visibility = function() {
var _ = this;
if ( _.options.autoplay ) {
if ( document[_.hidden] ) {
_.interrupted = true;
} else {
_.interrupted = false;
}
}
};
$.fn.slick = function() {
var _ = this,
opt = arguments[0],
args = Array.prototype.slice.call(arguments, 1),
l = _.length,
i,
ret;
for (i = 0; i < l; i++) {
if (typeof opt == 'object' || typeof opt == 'undefined')
_[i].slick = new Slick(_[i], opt);
else
ret = _[i].slick[opt].apply(_[i].slick, args);
if (typeof ret != 'undefined') return ret;
}
return _;
};
})(jQuery);
! function(e, t) {
"object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.AOS = t() : e.AOS = t()
}(this, function() {
return function(e) {
function t(o) {
if (n[o]) return n[o].exports;
var i = n[o] = {
exports: {},
id: o,
loaded: !1
};
return e[o].call(i.exports, i, i.exports, t), i.loaded = !0, i.exports
}
var n = {};
return t.m = e, t.c = n, t.p = "dist/", t(0)
}([function(e, t, n) {
"use strict";
function o(e) {
return e && e.__esModule ? e : {
default: e
}
}
var i = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o])
}
return e
},
r = n(1),
a = (o(r), n(6)),
u = o(a),
c = n(7),
f = o(c),
s = n(8),
d = o(s),
l = n(9),
p = o(l),
m = n(10),
b = o(m),
v = n(11),
y = o(v),
g = n(14),
h = o(g),
w = [],
k = !1,
x = {
targetSlector: "body",
offset: 120,
delay: 0,
easing: "ease",
duration: 400,
disable: !1,
once: !1,
startEvent: "DOMContentLoaded",
throttleDelay: 99,
debounceDelay: 50,
disableMutationObserver: !1
},
j = function() {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
if (e && (k = !0), k) return w = (0, y.default)(w, x), (0, b.default)(w, x.once), w
},
O = function() {
w = (0, h.default)(), j()
},
_ = function() {
w.forEach(function(e, t) {
e.node.removeAttribute("data-aos"), e.node.removeAttribute("data-aos-easing"), e.node.removeAttribute("data-aos-duration"), e.node.removeAttribute("data-aos-delay")
})
},
S = function(e) {
return e === !0 || "mobile" === e && p.default.mobile() || "phone" === e && p.default.phone() || "tablet" === e && p.default.tablet() || "function" == typeof e && e() === !0
},
z = function(e) {
x = i(x, e), w = (0, h.default)();
var t = document.all && !window.atob;
return S(x.disable) || t ? _() : (document.querySelector(x.targetSlector).setAttribute("data-aos-easing", x.easing), document.querySelector(x.targetSlector).setAttribute("data-aos-duration", x.duration), document.querySelector(x.targetSlector).setAttribute("data-aos-delay", x.delay), "DOMContentLoaded" === x.startEvent && ["complete", "interactive"].indexOf(document.readyState) > -1 ? j(!0) : "load" === x.startEvent ? window.addEventListener(x.startEvent, function() {
j(!0)
}) : document.addEventListener(x.startEvent, function() {
j(!0)
}), window.addEventListener("resize", (0, f.default)(j, x.debounceDelay, !0)), window.addEventListener("orientationchange", (0, f.default)(j, x.debounceDelay, !0)), window.addEventListener("scroll", (0, u.default)(function() {
(0, b.default)(w, x.once)
}, x.throttleDelay)), x.disableMutationObserver || (0, d.default)("[data-aos]", O), w)
};
e.exports = {
init: z,
refresh: j,
refreshHard: O
}
}, function(e, t) {}, , , , , function(e, t) {
(function(t) {
"use strict";
function n(e, t, n) {
function o(t) {
var n = b,
o = v;
return b = v = void 0, k = t, g = e.apply(o, n)
}
function r(e) {
return k = e, h = setTimeout(s, t), _ ? o(e) : g
}
function a(e) {
var n = e - w,
o = e - k,
i = t - n;
return S ? j(i, y - o) : i
}
function c(e) {
var n = e - w,
o = e - k;
return void 0 === w || n >= t || n < 0 || S && o >= y
}
function s() {
var e = O();
return c(e) ? d(e) : void(h = setTimeout(s, a(e)))
}
function d(e) {
return h = void 0, z && b ? o(e) : (b = v = void 0, g)
}
function l() {
void 0 !== h && clearTimeout(h), k = 0, b = w = v = h = void 0
}
function p() {
return void 0 === h ? g : d(O())
}
function m() {
var e = O(),
n = c(e);
if (b = arguments, v = this, w = e, n) {
if (void 0 === h) return r(w);
if (S) return h = setTimeout(s, t), o(w)
}
return void 0 === h && (h = setTimeout(s, t)), g
}
var b, v, y, g, h, w, k = 0,
_ = !1,
S = !1,
z = !0;
if ("function" != typeof e) throw new TypeError(f);
return t = u(t) || 0, i(n) && (_ = !!n.leading, S = "maxWait" in n, y = S ? x(u(n.maxWait) || 0, t) : y, z = "trailing" in n ? !!n.trailing : z), m.cancel = l, m.flush = p, m
}
function o(e, t, o) {
var r = !0,
a = !0;
if ("function" != typeof e) throw new TypeError(f);
return i(o) && (r = "leading" in o ? !!o.leading : r, a = "trailing" in o ? !!o.trailing : a), n(e, t, {
leading: r,
maxWait: t,
trailing: a
})
}
function i(e) {
var t = "undefined" == typeof e ? "undefined" : c(e);
return !!e && ("object" == t || "function" == t)
}
function r(e) {
return !!e && "object" == ("undefined" == typeof e ? "undefined" : c(e))
}
function a(e) {
return "symbol" == ("undefined" == typeof e ? "undefined" : c(e)) || r(e) && k.call(e) == d
}
function u(e) {
if ("number" == typeof e) return e;
if (a(e)) return s;
if (i(e)) {
var t = "function" == typeof e.valueOf ? e.valueOf() : e;
e = i(t) ? t + "" : t
}
if ("string" != typeof e) return 0 === e ? e : +e;
e = e.replace(l, "");
var n = m.test(e);
return n || b.test(e) ? v(e.slice(2), n ? 2 : 8) : p.test(e) ? s : +e
}
var c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
},
f = "Expected a function",
s = NaN,
d = "[object Symbol]",
l = /^\s+|\s+$/g,
p = /^[-+]0x[0-9a-f]+$/i,
m = /^0b[01]+$/i,
b = /^0o[0-7]+$/i,
v = parseInt,
y = "object" == ("undefined" == typeof t ? "undefined" : c(t)) && t && t.Object === Object && t,
g = "object" == ("undefined" == typeof self ? "undefined" : c(self)) && self && self.Object === Object && self,
h = y || g || Function("return this")(),
w = Object.prototype,
k = w.toString,
x = Math.max,
j = Math.min,
O = function() {
return h.Date.now()
};
e.exports = o
}).call(t, function() {
return this
}())
}, function(e, t) {
(function(t) {
"use strict";
function n(e, t, n) {
function i(t) {
var n = b,
o = v;
return b = v = void 0, O = t, g = e.apply(o, n)
}
function r(e) {
return O = e, h = setTimeout(s, t), _ ? i(e) : g
}
function u(e) {
var n = e - w,
o = e - O,
i = t - n;
return S ? x(i, y - o) : i
}
function f(e) {
var n = e - w,
o = e - O;
return void 0 === w || n >= t || n < 0 || S && o >= y
}
function s() {
var e = j();
return f(e) ? d(e) : void(h = setTimeout(s, u(e)))
}
function d(e) {
return h = void 0, z && b ? i(e) : (b = v = void 0, g)
}
function l() {
void 0 !== h && clearTimeout(h), O = 0, b = w = v = h = void 0
}
function p() {
return void 0 === h ? g : d(j())
}
function m() {
var e = j(),
n = f(e);
if (b = arguments, v = this, w = e, n) {
if (void 0 === h) return r(w);
if (S) return h = setTimeout(s, t), i(w)
}
return void 0 === h && (h = setTimeout(s, t)), g
}
var b, v, y, g, h, w, O = 0,
_ = !1,
S = !1,
z = !0;
if ("function" != typeof e) throw new TypeError(c);
return t = a(t) || 0, o(n) && (_ = !!n.leading, S = "maxWait" in n, y = S ? k(a(n.maxWait) || 0, t) : y, z = "trailing" in n ? !!n.trailing : z), m.cancel = l, m.flush = p, m
}
function o(e) {
var t = "undefined" == typeof e ? "undefined" : u(e);
return !!e && ("object" == t || "function" == t)
}
function i(e) {
return !!e && "object" == ("undefined" == typeof e ? "undefined" : u(e))
}
function r(e) {
return "symbol" == ("undefined" == typeof e ? "undefined" : u(e)) || i(e) && w.call(e) == s
}
function a(e) {
if ("number" == typeof e) return e;
if (r(e)) return f;
if (o(e)) {
var t = "function" == typeof e.valueOf ? e.valueOf() : e;
e = o(t) ? t + "" : t
}
if ("string" != typeof e) return 0 === e ? e : +e;
e = e.replace(d, "");
var n = p.test(e);
return n || m.test(e) ? b(e.slice(2), n ? 2 : 8) : l.test(e) ? f : +e
}
var u = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
},
c = "Expected a function",
f = NaN,
s = "[object Symbol]",
d = /^\s+|\s+$/g,
l = /^[-+]0x[0-9a-f]+$/i,
p = /^0b[01]+$/i,
m = /^0o[0-7]+$/i,
b = parseInt,
v = "object" == ("undefined" == typeof t ? "undefined" : u(t)) && t && t.Object === Object && t,
y = "object" == ("undefined" == typeof self ? "undefined" : u(self)) && self && self.Object === Object && self,
g = v || y || Function("return this")(),
h = Object.prototype,
w = h.toString,
k = Math.max,
x = Math.min,
j = function() {
return g.Date.now()
};
e.exports = n
}).call(t, function() {
return this
}())
}, function(e, t) {
"use strict";
function n(e, t) {
var n = window.document,
r = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver,
a = new r(o);
i = t, a.observe(n.documentElement, {
childList: !0,
subtree: !0,
removedNodes: !0
})
}
function o(e) {
e && e.forEach(function(e) {
var t = Array.prototype.slice.call(e.addedNodes),
n = Array.prototype.slice.call(e.removedNodes),
o = t.concat(n).filter(function(e) {
return e.hasAttribute && e.hasAttribute("data-aos")
}).length;
o && i()
})
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var i = function() {};
t.default = n
}, function(e, t) {
"use strict";
function n(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
function o() {
return navigator.userAgent || navigator.vendor || window.opera || ""
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var i = function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var o = t[n];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
return function(t, n, o) {
return n && e(t.prototype, n), o && e(t, o), t
}
}(),
r = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,
a = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,
u = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,
c = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,
f = function() {
function e() {
n(this, e)
}
return i(e, [{
key: "phone",
value: function() {
var e = o();
return !(!r.test(e) && !a.test(e.substr(0, 4)))
}
}, {
key: "mobile",
value: function() {
var e = o();
return !(!u.test(e) && !c.test(e.substr(0, 4)))
}
}, {
key: "tablet",
value: function() {
return this.mobile() && !this.phone()
}
}]), e
}();
t.default = new f
}, function(e, t) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var n = function(e, t, n) {
var o = e.node.getAttribute("data-aos-once");
//수정
//t > e.position ? e.node.classList.add("aos-animate") : "undefined" != typeof o && ("false" === o || !n && "true" !== o) && e.node.classList.remove("aos-animate")
t > (e.position - 100) ? e.node.classList.add("aos-animate") : "undefined" != typeof o && ("false" === o || !n && "true" !== o) && e.node.classList.remove("aos-animate")
},
o = function(e, t) {
var o = window.pageYOffset,
i = window.innerHeight;
e.forEach(function(e, r) {
n(e, i + o, t)
})
};
t.default = o
}, function(e, t, n) {
"use strict";
function o(e) {
return e && e.__esModule ? e : {
default: e
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var i = n(12),
r = o(i),
a = function(e, t) {
return e.forEach(function(e, n) {
e.node.classList.add("aos-init"), e.position = (0, r.default)(e.node, t.offset)
}), e
};
t.default = a
}, function(e, t, n) {
"use strict";
function o(e) {
return e && e.__esModule ? e : {
default: e
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var i = n(13),
r = o(i),
a = function(e, t) {
var n = 0,
o = 0,
i = window.innerHeight,
a = {
offset: e.getAttribute("data-aos-offset"),
anchor: e.getAttribute("data-aos-anchor"),
anchorPlacement: e.getAttribute("data-aos-anchor-placement")
};
switch (a.offset && !isNaN(a.offset) && (o = parseInt(a.offset)), a.anchor && document.querySelectorAll(a.anchor) && (e = document.querySelectorAll(a.anchor)[0]), n = (0, r.default)(e).top, a.anchorPlacement) {
case "top-bottom":
break;
case "center-bottom":
n += e.offsetHeight / 2;
break;
case "bottom-bottom":
n += e.offsetHeight;
break;
case "top-center":
n += i / 2;
break;
case "bottom-center":
n += i / 2 + e.offsetHeight;
break;
case "center-center":
n += i / 2 + e.offsetHeight / 2;
break;
case "top-top":
n += i;
break;
case "bottom-top":
n += e.offsetHeight + i;
break;
case "center-top":
n += e.offsetHeight / 2 + i
}
return a.anchorPlacement || a.offset || isNaN(t) || (o = t), n + o
};
t.default = a
}, function(e, t) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var n = function(e) {
for (var t = 0, n = 0; e && !isNaN(e.offsetLeft) && !isNaN(e.offsetTop);) t += e.offsetLeft - ("BODY" != e.tagName ? e.scrollLeft : 0), n += e.offsetTop - ("BODY" != e.tagName ? e.scrollTop : 0), e = e.offsetParent;
return {
top: n,
left: t
}
};
t.default = n
}, function(e, t) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var n = function(e) {
return e = e || document.querySelectorAll("[data-aos]"), Array.prototype.map.call(e, function(e) {
return {
node: e
}
})
};
t.default = n
}])
});
/********************************************************************************************
환경설정
절대 삭제하시면 안됩니다.
절대절대 삭제하지 마세요~~
********************************************************************************************/
/* 공통환경 */
/* 메인팝업배너 설정 */
window.bannerOn = false; // ( true:사용, false:사용안함 )
window.bannerRef = "/roma/import/popup3.html"; //배너주소(수정하지마세요)
/* 상세페이지 추가이미지 액션 */
window.addImagAction = "click"; // ( click 또는 mouseover )
function change_parent_url(url){
window.parent.location.href=url;
};
function filter2() {
let search = document.getElementById("keyword-store").value.toLowerCase();
let listInner = document.getElementsByClassName("listInner");
for (let i = 0; i < listInner.length; i++) {
city = listInner[i].getElementsByClassName("kor-tit");
country = listInner[i].getElementsByClassName("addr");
if (city[0].innerHTML.toLowerCase().indexOf(search) != -1 || country[0].innerHTML.toLowerCase().indexOf(search) != -1) {
listInner[i].style.display = "block"
} else {
listInner[i].style.display = "none"
}
}
}
// 레디 //
$(document).ready(function(){
makeSliderSlick();
/* 백그라운드 fixed일때 안흔들리게 백그라운고정 및 스크롤부드럽게(버벅임해소) - 현재 마우스만 가능 - nano,jqueryscrollbar 스크롤러와 충돌남(IE에서)*/
function makeMouseEvent(){
if(navigator.userAgent.match(/Trident\/7\./)) { // if IE
$('body.main').on("mousewheel", function () {
event.preventDefault();
var wheelDelta = event.wheelDelta - 10;
var currentScrollPosition = window.pageYOffset;
window.scrollTo(0, currentScrollPosition - wheelDelta);
});
}
};
//makeMouseEvent();
/* 메인 default1_k.html 등 관련 */
$(".-main-k .prdList > li > a.ease").click(function(e) {
var $this = $(this);
if ($this.hasClass("-on")) {
$this.removeClass("-on");
} else {
$this.parents('.prdList').find("a.-on").removeClass("-on");
$this.addClass("-on");
}
});
//search.html에서 검색정렬 셀렉트박스
$("#selArrayS").change(function(){
var a = $(this).val();
$('.searchHome #order_by').val(a);
$('.searchHome #searchForm').submit();
});
$('#selArrayS option').each(function( index ) {
var style = $(this).attr('style');
if(style){
$(this).attr('selected','selected');
}
});
//무료체험이벤트(긴급문의)
$('.-mainfreesend').click(function(e) {
check();
e.preventDefault();
});
function check(){
var ifra = document.getElementById('ifraList').contentWindow;
ifra.sendData();
$('#ifraList').contents().find('#-uSubmit').trigger('click');
setTimeout(function() {
$('#ifraList').attr('src' ,'/roma/main/section29_1.html');
}, 500);
};
/* 검색창 검색어 설정시 X버튼클릭시 검색어 삭제 */
$('.searchField .btnDelete').click(function(e) {
$('.searchField .keyword').val('');
//$('#searchBarForm #banner_action').val('');
});
$('.searchForm .btnDelete').click(function(e) {
$('.searchForm .inputTypeText').val('');
$('#searchBarForm #banner_action').val('');
});
$('.topSearch .btnDelete').click(function(e) {
$('.topSearch .inputTypeText').val('');
$('#searchBarForm #banner_action').val('');
});
$(".xans-layout-searchheader #keyword").attr('onmousedown', '').unbind('onmousedown');
$(".xans-layout-searchheader #keyword").click(function(e) {
$(".xans-layout-searchheader").find(".inputTypeText").val('');
$('#searchBarForm #banner_action').val('');
});
/* 동영상팝업 - 사용안함 사용하기 위해서는 메인에서 해줘야한다 */
/*
$('a[videoid="on"]').each(function( index ) {
$(this).YouTubePopUp();
});
$('div[videoid="on"]').each(function( index ) {
$(this).YouTubePopUp();
});
*/
$('.-bg-bannerimg').each(function( index ) {
var bg2 = $(this).find(".-bannerimg img").attr('src');
//$(this).parents('.bg-bannerimg-wrap').css({
$(this).css({
'background': 'url(' + bg2 + ')',
'background-repeat': 'no-repeat',
'background-position': '50% 50%',
'background-size': 'cover'
});
});
/* 카테고리 할인퍼센트 */
setDiscount6('.prdList.-cate li','.prd_price_sale', '.xans-product-listnormal .prdList.-cate');
setDiscount6('.-mc1 .prdList li', '.prd_price_sale', '.-mc1');
setDiscount6('.-mc2 .prdList li', '.prd_price_sale', '.-mc2');
setDiscount6('.-mc3 .prdList li', '.prd_price_sale', '.-mc3');
setDiscount6('.-mc4 .prdList li', '.prd_price_sale', '.-mc4');
setDiscount6('.-mc5 .prdList li', '.prd_price_sale', '.-mc5');
setDiscount6('.-mc6 .prdList li', '.prd_price_sale', '.-mc6');
setDiscount6('.-mc7 .prdList li', '.prd_price_sale', '.-mc7');
setDiscount6('.-mc8 .prdList li', '.prd_price_sale', '.-mc8');
setDiscount6('.-mc9 .prdList li', '.prd_price_sale', '.-mc9');
setDiscount6('.-mc10 .prdList li', '.prd_price_sale', '.-mc10');
/*보류
$('.xans-product-listmain').each(function( index ) {
var saleEnable1 = ($(this).attr('data-sale')) ? $(this).attr('data-sale') : 'false';
var saleEnable = (saleEnable1 == 'true') ? true : false;
console.log(index +":" + saleEnable);
if(saleEnable){
setDiscount7('.-mc1 .prdList li', '.prd_price_sale');
}
});
*
/* 상세페이지 할인퍼센트 */
setDiscount4_detail('.prdDescription','.-detail-sale-rate');
$(".discountPeriod .layerDiscountPeriod").click(function(e){
e.preventDefault();
$(this).css("display","none");
});
$(document).ajaxSuccess(function(evt, request, settings) {
var sUrl = settings.url;
if(sUrl.indexOf("ApiProductMain") != -1 || sUrl.indexOf("ApiProductNormal") != -1){
/*
$('a[videoid="on"]').each(function( index ) {
$(this).YouTubePopUp();
});
*/
$(".prd_promotion_date").mouseover(function(){
$(this).find(".layerDiscountPeriod").css("display","block");
});
$(".prd_promotion_date").mouseleave(function(){
$(this).find(".layerDiscountPeriod").css("display","none");
});
$(".discountPeriod .layerDiscountPeriod").click(function(e){
e.preventDefault();
$(this).css("display","none");
});
setDiscount6('.prdList.-cate li','.prd_price_sale', '.xans-product-listnormal .prdList.-cate');
setDiscount6('.-mc1 .prdList li', '.prd_price_sale', '.-mc1');
setDiscount6('.-mc2 .prdList li', '.prd_price_sale', '.-mc2');
setDiscount6('.-mc3 .prdList li', '.prd_price_sale', '.-mc3');
setDiscount6('.-mc4 .prdList li', '.prd_price_sale', '.-mc4');
setDiscount6('.-mc5 .prdList li', '.prd_price_sale', '.-mc5');
setDiscount6('.-mc6 .prdList li', '.prd_price_sale', '.-mc6');
setDiscount6('.-mc7 .prdList li', '.prd_price_sale', '.-mc7');
setDiscount6('.-mc8 .prdList li', '.prd_price_sale', '.-mc8');
setDiscount6('.-mc9 .prdList li', '.prd_price_sale', '.-mc9');
setDiscount6('.-mc10 .prdList li', '.prd_price_sale', '.-mc10');
}
});
/*
$('.xans-product-listnormal').on("DOMNodeInserted", 'li[id^=anchorBoxId]', function() {
//console.log($(this).find('.all-price').html());
console.log($(this).attr('id')); //this == li[id^=anchorBoxId]
$('.sold_icore').each(function() {
if ($(this).find('img').size() === 1) {
$(this).html('SOLD OUT');
}
});
});
*/
$('.xans-product-additional .productDetail img').each(function( index ) {
var ec_src = $(this).attr('ec-data-src');
$(this).removeAttr('ec-data-src');
if(ec_src){
$(this).attr('src',ec_src);
}
});
/* 슬라이더 만들기 */
function makeNanoScroller( target ){
var _sliderTarget = (target) ? target.find('[scroller]') : $('[scroller]') ;
_sliderTarget.each(function( index ) {
var _slider = $(this);
_slider.nanoScroller({ preventPageScrolling: false });
/*
_slider.bind("scrollend", function(e){
_slider.nanoScroller({ destroy: true });
console.log("current HTMLDivElement", e.currentTarget);
});
*/
});
};
makeNanoScroller();
/* 스크롤러와 충돌을 피하기 위해 */
$('[scroller]').on("mouseover", function () {
$('body').off('mousewheel');
});
/* 로마팝업 */
function setCookie( name, value, expiredays ) {
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
};
var cookiePop = document.cookie;
if ( cookiePop.indexOf("romapop=done") < 0 ){
$('#divclass').removeClass('is-visible'); //시작시 큰 이미지
$('.romapop_open').css('display','block');
}else {
$('#divclass').addClass('is-visible'); //시작시 큰 이미지
$('.romapop_open').css('display','none');
}
$( '.romapop_open, .popclose' ).click( function() {
$('#divclass').toggleClass('is-visible');
if ( document.getElementById('romapopcheck').checked ){
setCookie( "romapop", "done" , 1 );
$('.romapop_open').css('display','none');
}
return false;
});
/* 탭메뉴 */
$('[tabsnav] > .-nav').mouseover(function(e){
$('[tabsnav] > .-nav').removeClass('active');
if($(this).hasClass('active')){
$(this).removeClass('active');
}else{
$(this).addClass('active');
}
});
$('.tabs-nav li').click(function(e){
$('.tabs-nav li').removeClass('active');
$('[tabsnav] li').removeClass('active');
$(this).toggleClass('active');
$('[tabsnav] li').eq($(this).index()).addClass('active');
});
/* mobilecategory more_btn */
$('.toggle_btn').click(function(e) {
$('.toggle_btn i').toggleClass("xi-angle-up-thin");
$('#topmenu_more').toggleClass("-on");
});
/* 하단 설문조사버튼 */
$('.-pollbtn').click(function(e) {
e.preventDefault();
$('.-footer-etc .poll').toggleClass("-on");
});
$('.-xans-layout-poll-layer .-poll-close').click(function(e) {
e.preventDefault();
$('.-footer-etc .poll').removeClass("-on");
});
/* 메인 동영상 팝업 mainsection8 Video */
if($( '.swipebox-video' ).length){
$( '.swipebox-video' ).find('img').removeClass('banner_image');
$( '.swipebox-video' ).swipebox();
};
$('.searching').click(function(e) {
$('.second2').toggleClass('open');
e.preventDefault();
});
$('.search_open .search_close').click(function(e) {
$('.second2').removeClass('open');
e.preventDefault();
});
if( window.prd_over ){
$(".prdList_cell li").mouseover(function(){
$(this).find(".thumb.-hover").fadeIn();
}
);
$(".prdList_cell li").mouseleave(function(){
$(this).find(".thumb.-hover").fadeOut();
}
);
};
/* 헤더 마우스오버 */
var stub_showing = false;
var biggestHeight = 0;
$('.second').each(function( index ) {
if($(this).height() > biggestHeight){
biggestHeight = $(this).height();
}
});
/* 특정엘리먼트로 부드럽게 이동(detail.html - tabproduct) */
$(".tabProduct.-tp0 ul li a").click(function() {
$(this).parents('ul').find('li').removeClass('selected');
$(this).closest('li').addClass('selected');
var scrollPosition = $($(this).data("target")).offset().top - 100;
$('body,html').animate({scrollTop: scrollPosition}, 250);
});
var sc = jQuery(window).scrollTop();
$(".tabProduct.-tp0 ul li a").each(function( index ) {
var tabTop = $($(this).data("target")).offset().top;
if (sc > tabTop - 100) {
$(".tabProduct.-tp0 ul li").removeClass('selected');
$(".tabProduct.-tp0 ul li a[data-target='"+$(this).data("target") + "']").closest('li').addClass("selected");
}
});
jQuery(window).scroll(function() {
var sc = jQuery(window).scrollTop();
$(".tabProduct.-tp0 ul li a").each(function( index ) {
var tabTop = $($(this).data("target")).offset().top;
if (sc > tabTop - 100) {
$(".tabProduct.-tp0 ul li").removeClass('selected');
$(".tabProduct.-tp0 ul li a[data-target='"+$(this).data("target") + "']").closest('li').addClass("selected");
}
});
});
/* 할인율 - new */
function setDiscount5(a,b,c){
var saleEnable1 = ($(c).attr('data-sale')) ? $(c).attr('data-sale') : 'false';
var saleEnable = (saleEnable1 == 'true') ? true : false;
if(saleEnable){
$(a).find('.all-price').each(function( index ) {
var customPrice = ($(this).find('.p1').text()) ? String($(this).find('.p1').text()).replace(/,/g,'').replace(/원/g,'') : 0 ;
var currentPrice = ($(this).find('.p2').text()) ? String($(this).find('.p2').text()).replace(/,/g,'').replace(/원/g,'') : 0 ;
$(this).find('.p3 > span').remove();
$(this).find('.p4 > span > span').remove();
var salePrice = $(this).find('.p3').text();
var salePrice2 = $(this).find('.p4').text();
salePrice = (salePrice) ? salePrice : salePrice2;
var regExp2 = /[^0-9.]/g; //소수점과 숫자외 모두없앤다.
var regExp = /(\.\d+)+/; //소주점과 소수점 아래 숫자 없앤다.
salePrice = salePrice ? String(salePrice).replace(regExp2,'') : 0 ;
customPrice = ($.isNumeric(customPrice)) ? Number(customPrice) : customPrice ;
currentPrice = ($.isNumeric(currentPrice)) ? Number(currentPrice) : currentPrice ;
salePrice = ($.isNumeric(salePrice)) ? Number(salePrice) : salePrice ;
var pRate = 0;
if( currentPrice > salePrice && salePrice > 0 ){
pRate = ((1-( salePrice / currentPrice )) * 100).toFixed(0);
}
if(!salePrice){
$this = $(this);
$(this).siblings('.description').find('.product_price .title + span').css('text-decoration','none');
}
var str = "" + pRate;
if(pRate){
$this = $(this);
$(this).siblings('.description').find('.product_price').addClass('-strike');
str = "" + str + "%";
if($this.siblings('.description').find('.prd_price_sale .per').length < 1){
if(b){
$(this).siblings('.description').find('.prd_price_sale .title').after(str);
}else{
$(this).siblings('.description').find('.prd_price_sale').append(str);
}
}
}
});
}
};
/* 소비자가 대비 할인율 */
function setDiscount6(a,b,c){
var saleEnable1 = ($(c).attr('data-sale')) ? $(c).attr('data-sale') : 'false';
var saleEnable = (saleEnable1 == 'true') ? true : false;
if(saleEnable){
$(a).find('.all-price').each(function( index ) {
$(this).find('.p2 > span').remove();
var customPrice = ($(this).find('.p1').text()) ? String($(this).find('.p1').text()).replace(/,/g,'').replace(/원/g,'') : 0 ;
var currentPrice = ($(this).find('.p2').text()) ? String($(this).find('.p2').text()).replace(/,/g,'').replace(/원/g,'') : 0 ;
$(this).find('.p3 > span').remove();
$(this).find('.p4 > span > span').remove();
var salePrice = $(this).find('.p3').text();
var salePrice2 = $(this).find('.p4').text();
salePrice = (salePrice) ? salePrice : salePrice2;
var regExp2 = /[^0-9.]/g; //소수점과 숫자외 모두없앤다.
var regExp = /(\.\d+)+/; //소주점과 소수점 아래 숫자 없앤다.;
salePrice = salePrice ? String(salePrice).replace(regExp2,'') : 0 ;
customPrice = ($.isNumeric(customPrice)) ? Number(customPrice) : customPrice ;
currentPrice = ($.isNumeric(currentPrice)) ? Number(currentPrice) : currentPrice ;
salePrice = ($.isNumeric(salePrice)) ? Number(salePrice) : salePrice ;
var pRate = 0;
var str = "";
if( customPrice > currentPrice && currentPrice > salePrice && customPrice > 0 && salePrice > 0 ){
pRate = ((1-( salePrice / customPrice )) * 100).toFixed(0);
if(pRate){
$this = $(this);
$(this).siblings('.description').find('.product_price').addClass('-strike');
str = "" + pRate + "%";
if($this.siblings('.description').find('.prd_price_sale .per').length < 1){
if(b){
$(this).siblings('.description').find('.prd_price_sale .title').after(str);
}else{
$(this).siblings('.description').find('.prd_price_sale').append(str);
}
}
}
}else if( customPrice > currentPrice ){
pRate = ((1-( currentPrice / customPrice )) * 100).toFixed(0);
if(pRate){
$this = $(this);
str = "" + pRate + "%";
if($this.siblings('.description').find('.product_price .per').length < 1){
if(b){
$(this).siblings('.description').find('.product_price .title').after(str);
}else{
$(this).siblings('.description').find('.product_price').append(str);
}
}
}
}else if( currentPrice > salePrice && salePrice > 0 ){
pRate = ((1-( salePrice / currentPrice )) * 100).toFixed(0);
if(pRate){
$this = $(this);
$(this).siblings('.description').find('.product_price').addClass('-strike');
str = "" + pRate + "%";
if($this.siblings('.description').find('.prd_price_sale .per').length < 1){
if(b){
$(this).siblings('.description').find('.prd_price_sale .title').after(str);
}else{
$(this).siblings('.description').find('.prd_price_sale').append(str);
}
}
}
};
if(!salePrice){
$this = $(this);
$(this).siblings('.description').find('.product_price .title + span').css('text-decoration','none');
}
});
}
};
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function setDiscount3_detail(a,b){
var saleEnable1 = ($('.prdDescription').attr('data-sale')) ? $('.prdDescription').attr('data-sale') : 'false';
var saleEnable = (saleEnable1 == 'true') ? true : false;
if( $('.prdDescription').length && saleEnable ){
//var regExp = /[^0-9]/gi;
var regExp = /[^0-9.]/g; //소수점과 숫자외 모두없앤다.
var customPrice = $('.prdDescription .all-price').find('.p1').text();
customPrice = customPrice.replace(regExp,'');
var product_price = $('.prdDescription .all-price').find('.p2').text();
product_price = product_price.replace(regExp,'');
var prd_price_sale3 = $('.prdDescription .all-price').find('.p3').text();
prd_price_sale3 = prd_price_sale3.replace(regExp,'');
var prd_price_sale4 = $('.prdDescription .all-price').find('.p4').text();
prd_price_sale4 = prd_price_sale4.replace(regExp,'');
var salePrice = (prd_price_sale3) ? prd_price_sale3 : prd_price_sale4;
customPrice = ($.isNumeric(customPrice)) ? Number(customPrice) : customPrice ;
currentPrice = ($.isNumeric(product_price)) ? Number(product_price) : product_price ;
salePrice = ($.isNumeric(salePrice)) ? Number(salePrice) : salePrice ;
var pRate = 0;
if( currentPrice > salePrice && salePrice > 0 ){
pRate = ((1-( salePrice / currentPrice )) * 100).toFixed(0);
}
if(product_price == ""){
$('.-detaildesign2.-price > .product_price_css').html("");
return;
}
var str = "";
if(pRate){
$this = $(a).find('.all-price');
str = ""+ pRate +"%";
}
if(pRate <= 0){
setTimeout(function() {
//var prd_p = $('.info tr.product_price_css #span_product_price_text').html();
var prd_p = ""+ numberWithCommas(currentPrice) + "원";
$('.-detaildesign2.-price > .product_price_css').html(prd_p);
}, 100);
}else{
var prd_p = ""+ numberWithCommas(currentPrice) + "원";
var sale_p = ""+ numberWithCommas(salePrice) + "원";
setTimeout(function() {
$('.-detaildesign2.-price .product_price_css').html(str + prd_p);
$('.-detaildesign2.-price .prd_price_sale_css').html(sale_p);
}, 100);
}
setTimeout(function() {
$('.-detaildesign2.-price').css('visibility','visible');
}, 200);
}
};
// 재고수량표시 - /product/stocklayer.html 수정 {$stock_value} |
$(".stock_quantity_css_cont a").trigger("click");
setTimeout(function() {
//console.log($('.ec-shop-detail-stock-layer .xans-product-stocklayer .content table .svalue').length);
var regExp = /[^0-9.]/g; //소수점과 숫자외 모두없앤다.
var stock_sum = 0;
$('.ec-shop-detail-stock-layer .xans-product-stocklayer .content table .svalue').each(function( index ) {
var stock_value = $(this).text();
stock_value = stock_value.replace(regExp,'');
stock_sum = stock_sum + Number(stock_value);
});
var title = $('.-stock-rom').attr('data-title');
if(stock_sum){
$('.-stock-rom .-stock-rom-title').text(title);
$('.-stock-rom').append(''+stock_sum+'
');
}
}, 200);
// 소비자가 대비
function setDiscount4_detail(a,b){
var saleEnable1 = ($('.prdDescription').attr('data-sale')) ? $('.prdDescription').attr('data-sale') : 'false';
var saleEnable = (saleEnable1 == 'true') ? true : false;
//if( $('.prdDescription').length ){
if( $('.prdDescription').length && saleEnable ){
//var regExp = /[^0-9]/gi;
var regExp = /[^0-9.]/g; //소수점과 숫자외 모두없앤다.
var customPrice = $('.prdDescription .all-price').find('.p1').text();
customPrice = customPrice.replace(regExp,'');
var product_price = $('.prdDescription .all-price').find('.p2').text();
product_price = product_price.replace(regExp,'');
var prd_price_sale3 = $('.prdDescription .all-price').find('.p3').text();
prd_price_sale3 = prd_price_sale3.replace(regExp,'');
var prd_price_sale4 = $('.prdDescription .all-price').find('.p4').text();
prd_price_sale4 = prd_price_sale4.replace(regExp,'');
var salePrice = (prd_price_sale3) ? prd_price_sale3 : prd_price_sale4;
customPrice = ($.isNumeric(customPrice)) ? Number(customPrice) : customPrice ;
currentPrice = ($.isNumeric(product_price)) ? Number(product_price) : product_price ;
salePrice = ($.isNumeric(salePrice)) ? Number(salePrice) : salePrice ;
var pRate = 0;
var price_cont = ".-detaildesign-ul .product_price_css .product_price_css_cont";
if( customPrice > currentPrice && currentPrice > salePrice && customPrice > 0 && salePrice > 0 ){
pRate = ((1-( salePrice / customPrice )) * 100).toFixed(0);
price_cont = ".-detaildesign-ul li[class*='price_sale'] span[class$='cont']";
}else if( customPrice > currentPrice ){
pRate = ((1-( currentPrice / customPrice )) * 100).toFixed(0);
}else if( currentPrice > salePrice && salePrice > 0 ){
pRate = ((1-( salePrice / currentPrice )) * 100).toFixed(0);
price_cont = ".-detaildesign-ul li[class*='price_sale'] span[class$='cont']";
}
if($('.prdBoard.-detail4').length > 0 && customPrice && currentPrice && (currentPrice > salePrice)){
$('.product_price_css').addClass('displaynone');
}
var str = "";
if(pRate){
$this = $(a).find('.all-price');
str = ""+ pRate +"%";
}
if(pRate <= 0){
}else{
setTimeout(function() {
//$(price_cont).append(str);
$(price_cont).prepend(str);
}, 100);
}
}
};
$( '#NaverChk_aa' ).click( function(e) {
e.preventDefault();
$('#NaverChk_Button').find('.npay_btn_link.npay_btn_pay').trigger('click');
});
$( '#Kakao_aa' ).click( function(e) {
e.preventDefault();
$('#kakao-checkout-button').find('.__checkout_btn_comm.__checkout_btn_buy').trigger('click');
});
/* 슬라이더 만들기 */
function makeSliderSlick( target ){
var _sliderTarget = (target) ? target.find('[slider_wrap_slick]') : $('[slider_wrap_slick]') ;
_sliderTarget.each(function( index ) {
var _slider = $(this);
var _sliderBox = _slider.find('[slider_box_slick]');
var _slideDdots = (_slider.data('dots')) ? true : false;
var _slideInfinite = (_slider.data('infinite')) ? true : true;
var _slideSpeed = (_slider.data('speed')) ? _slider.data('speed') : 500;
var _slideAutoplaySpeed = (_slider.data('autoplayspeed')) ? _slider.data('autoplayspeed') : 3000;
var _slideSidesToShow = (_slider.data('slidestoshow')) ? _slider.data('slidestoshow') : 1;
var _slidePauseOnHover = (_slider.data('pauseonhover')) ? true : false;
var _slideAutoplay = (_slider.data('autoplay')) ? true : false;
var _slideArrows = (_slider.data('arrows')) ? true : false;
var _slideFade = (_slider.data('fade')) ? true : false;
var _slideSlidesToScroll = (_slider.data('slidestoscroll')) ? _slider.data('slidestoscroll') : 1;
var _slideResponsive = (_slider.data('responsive')) ? true : false;
var _slideVertical = (_slider.data('vertical')) ? true : false;
/* 슬라이더의 기본값을 체크한다 */
_slider.find('.displaynone').remove();
_sliderBox.slick({
dots: (_slideDdots) ? true : false,
infinite: (_slideInfinite) ? true : false,
speed: _slideSpeed,
autoplaySpeed: _slideAutoplaySpeed,
slidesToShow: _slideSidesToShow,
pauseOnHover: (_slidePauseOnHover) ? true :false,
autoplay: (_slideAutoplay) ? true : false,
arrows: (_slideArrows) ? true : false,
fade:(_slideFade) ? true : false,
slidesToScroll: _slideSlidesToScroll,
vertical: _slideVertical
});
/*
setTimeout(function() {
_sliderBox.css({'visibility':'visible'});
}, 0);
*/
});
};
/* 위아래버튼 */
$( '.btn_up' ).click( function() {
$('body,html').animate({scrollTop:0},800);
return false;
} );
$( '.btn_down' ).click( function() {
$('body,html').animate({scrollTop:document.body.scrollHeight},800);
return false;
} );
/* 채팅 */
$('.chat-sticky-wrap a').click( function() {
$(this).parent('.chat-sticky-wrap').toggleClass('on');
return false;
} );
var didScroll;
var lastScrollTop = 0;
var delta = 5;
var navbarHeight = $('.main-header').outerHeight();
if($(window).scrollTop() > navbarHeight){
$('.page_header').removeClass('header_style_off_scroll').addClass('header_style_on_scroll');
$('body').removeClass('header_style_off_scroll').addClass('header_style_on_scroll');
}
/* 상세페이지 하단 */
$( '#NaverChk_aa' ).click( function(e) {
e.preventDefault();
$('#NaverChk_Button').find('.npay_btn_link.npay_btn_pay').trigger('click');
});
$( '#Kakao_aa' ).click( function(e) {
e.preventDefault();
$('#kakao-checkout-button').find('.__checkout_btn_comm.__checkout_btn_buy').trigger('click');
});
/* 상세페이지 구매돕기 이벤트 */
if( $('#cd-main-nav').length ){
var _pay = $('#cd-main-nav');
var _payMoney = 0;
//var _payScroll = $('#-payment-scroll').outerHeight();
var _payLeft = 0;
$(window).scroll(function () {
var winWidth = window.innerWidth;
if(winWidth >1024){
//if( $(window).scrollTop() >= $('.xans-product-detail').outerHeight() +200 ) {
if( $(window).scrollTop() >= $('.infoArea.prdDescription').outerHeight() +100 ) {
if( !_pay.hasClass('-fixed') ){
$('.detailArea > .infoArea').attr('style','height:'+$('.infoArea').outerHeight()+'px');
_pay.addClass('-fixed');
_pay.find('.nano > div:first-child').addClass('nano-content');
_pay.find('.nano').nanoScroller();
_pay.toggleClass('-open');
_pay.addClass('ease2');
};
}else{
if( _pay.hasClass('-fixed') ){
$('.detailArea > .infoArea').attr('style','');
_pay.removeClass('-fixed');
_pay.removeClass('ease2');
_pay.find('.nano > div:first-child').removeClass('nano-content');
_pay.find('.nano').nanoScroller({ destroy: true });
_pay.removeClass('-open');
};
}
}else{
if( _pay.hasClass('-fixed') ){
$('.detailArea > .infoArea').attr('style','');
_pay.removeClass('-fixed');
_pay.removeClass('ease2');
_pay.find('.nano > div:first-child').removeClass('nano-content');
_pay.find('.nano').nanoScroller({ destroy: true });
};
_pay.toggleClass('-open');
_pay.removeClass('ease2');
}
});
$(document).on('click', '#-payment-btn', function(e) {
_pay.toggleClass('-open');
_pay.addClass('ease2');
});
};
/* 오프라인매장 */
$(".off-shop").click(function(e){
e.preventDefault();
var $this=$(this),
el=$("#content-5"),
wrapper=$(".showcase"),
dur=700;
if(!el.is(":animated")){
wrapper.removeClass("transitions");
wrapper.fadeToggle(dur,function(){wrapper.addClass("transitions");});
}
$('body,html').animate({scrollTop : document.body.scrollHeight}, 0);
});
$('body').append("");
//$('body').append("");
// 스마트팝업 앱관련
var tCnt = 0;
var timerR = setInterval(function(){
if($('.app-smart-popup').length){
tCnt++;
$('.app-smart-popup:last-child').after("");
clearInterval(timerR);
}
},200);
$("body").delegate('.smart-popup-close','click',function(e) {
var popupCnt = $('.app-smart-popup').length;
var vGH = 0;
setTimeout(function() {
for(var i =0; i < popupCnt; i++){
if($('.app-smart-popup').eq(i).css('visibility') == 'hidden'){
vGH = vGH + 1;
}
if(popupCnt <= 1){
$('.dim-layer-BG').css('display','none');
}else if(popupCnt == vGH){
$('.dim-layer-BG').css('display','none');
}
}
}, 200);
});
$("body").delegate('.dim-layer-BG','click',function(e) {
var arr1 = [];
$('.app-smart-popup').each(function( index ) {
arr1.push($(this));
});
for(var i =0; i < arr1.length; i++){
if($(arr1[i]).css('visibility') != 'hidden'){
$(arr1[i]).css('visibility','hidden');
if(i == (arr1.length - 1)){
$(this).css('display','none');
}
return;
}
}
});
//팝업창 띄우기
$("a.-popup").click(function(e) {
e.preventDefault();
var $href = $(this).data('target');
var dhref = $(this).data('href2');
layer_popup($href,2); //큰팝업
$('#roma-review-iframe').attr('src',dhref);
});
function layer_popup(el,a){
var $el = $(el); //레이어의 id를 $el 변수에 저장
var isDim = $el.prev().hasClass('dimBg'); //dimmed 레이어를 감지하기 위한 boolean 변수
isDim ? $('.dim-layer').fadeIn() : $el.fadeIn();
var $elWidth = ~~($el.outerWidth()),
$elHeight = ~~($el.outerHeight()),
docWidth = $(document).width(),
docHeight = $(document).height();
$el.find('.close').click(function(){
isDim ? $('.dim-layer').fadeOut() : $el.fadeOut(); // 닫기 버튼을 클릭하면 레이어가 닫힌다.
if ( document.getElementById('romapopcheck').checked ){
setCookie( "romapopBanner", "done" , 1 );
}else{
}
$('#roma-review-iframe').attr('src',"");
$('#romapopcheckbox').removeClass('trans3');
return false;
});
$('.dimBg').click(function(){
$('.dim-layer').fadeOut();
$('#roma-review-iframe').attr('src',"");
$('#romapopcheckbox').removeClass('trans3');
return false;
});
};
if($("body.dnd.main").length && window.bannerOn){
if ( cookiePop.indexOf("romapopBanner=done") < 0 ){
$('#layer3').prepend('');
var dhref = window.bannerRef;
layer_popup('#layer3',2); //큰팝업
$('#roma-review-iframe').attr('src',dhref);
}else {
$('.dim-layer').fadeOut();
$('#roma-review-iframe').attr('src','');
}
}
function change_parent_url(url){
window.parent.location.href=url;
};
function move_url(url){
document.location.href=url;
}
$(".-des-vmiddle").click(function(e) {
e.preventDefault();
var dhref = $(this).data('href');
move_url(dhref);
});
});
/**
* 움직이는 배너 Jquery Plug-in
* @author cafe24
*/
/* header6 시리즈 */
(function($){
$.fn.floatBanner = function(options) {
options = $.extend({}, $.fn.floatBanner.defaults , options);
return this.each(function() {
var aPosition = $(this).position();
var jbOffset = $(this).offset();
var node = this;
var _top_s = 60;
if($('body').hasClass('-ckoff')){
_top_s = 90;
}
$(window).scroll(function() {
var _top = $(document).scrollTop();
_top = (aPosition.top < _top) ? _top : aPosition.top;
var _top_s2 = 60;
if($('body').hasClass('-ckoff')){
_top_s2 = 90;
}
if($('#-header').hasClass("fixed")){
_top = _top+_top_s2;
}
setTimeout(function () {
var newinit = $(document).scrollTop();
if ( newinit > jbOffset.top && $('#-header').hasClass("fixed")) {
if($('#-header').hasClass("fixed")){
_top = _top+_top_s2;
}
_top -= jbOffset.top;
var container_height = $("#container").height();
var quick_height = $(node).height();
var cul = container_height - quick_height;
if(_top > cul){
_top = cul+_top_s2;
}
//_top = _top + 50;
if(newinit >= container_height - 700){
_top = container_height - quick_height + 0;
$(node).stop().animate({top: _top}, options.animate);
}else{
$(node).stop().animate({top: _top}, options.animate);
}
} else if ( newinit <= jbOffset.top && $('#-header').hasClass("fixed")) {
if($('#-header').hasClass("fixed")){
_top = _top+_top_s2;
}
_top -= jbOffset.top;
var container_height = $("#container").height();
var quick_height = $(node).height();
var cul = container_height - quick_height;
if(_top > cul){
_top = cul+_top_s2;
}
//_top = _top + 50;
if(newinit >= container_height - 700){
_top = container_height - quick_height + 0;
$(node).stop().animate({top: _top}, options.animate);
}else{
$(node).stop().animate({top: _top}, options.animate);
}
}else{
_top = 0;
$(node).stop().animate({top: _top}, options.animate);
}
}, options.delay);
});
});
};
$.fn.floatBanner.defaults = {
'animate' : 500,
'delay' : 500
};
})(jQuery);
/**
* 움직이는 배너 Jquery Plug-in
* @author cafe24
*/
/* header5 시리즈
(function($){
$.fn.floatBanner = function(options) {
options = $.extend({}, $.fn.floatBanner.defaults , options);
return this.each(function() {
var aPosition = $(this).position();
var jbOffset = $(this).offset();
var node = this;
$(window).scroll(function() {
var _top = $(document).scrollTop();
_top = (aPosition.top < _top) ? _top : aPosition.top;
if($('#header_nav').hasClass("sticky")){
_top = _top+80;
}
setTimeout(function () {
var newinit = $(document).scrollTop();
//console.log(newinit+":"+jbOffset.top);
if ( newinit > jbOffset.top && $('#header_nav').hasClass("sticky")) {
if($('#header_nav').hasClass("sticky")){
_top = _top+80;
}
_top -= jbOffset.top;
var container_height = $("#container").height();
var quick_height = $(node).height();
var cul = container_height - quick_height;
if(_top > cul){
_top = cul+0;
}
//_top = _top + 50;
if(newinit >= container_height - 700){
_top = container_height - quick_height + 0;
$(node).stop().animate({top: _top}, options.animate);
}else{
$(node).stop().animate({top: _top}, options.animate);
}
}else if ( newinit <= jbOffset.top && $('#header_nav').hasClass("sticky")) {
if($('#header_nav').hasClass("sticky")){
_top = _top+80;
}
_top -= jbOffset.top;
var container_height = $("#container").height();
var quick_height = $(node).height();
var cul = container_height - quick_height;
if(_top > cul){
_top = cul+0;
}
//_top = _top + 50;
if(newinit >= container_height - 700){
_top = container_height - quick_height + 0;
$(node).stop().animate({top: _top}, options.animate);
}else{
$(node).stop().animate({top: _top}, options.animate);
}
}else{
_top = 0;
$(node).stop().animate({top: _top}, options.animate);
}
}, options.delay);
});
});
};
$.fn.floatBanner.defaults = {
'animate' : 500,
'delay' : 500
};
})(jQuery);
*/
/* header 7시리즈
(function($){
$.fn.floatBanner = function(options) {
options = $.extend({}, $.fn.floatBanner.defaults , options);
return this.each(function() {
var aPosition = $(this).position();
var jbOffset = $(this).offset();
var node = this;
$(window).scroll(function() {
var _top = $(document).scrollTop();
_top = (aPosition.top < _top) ? _top : aPosition.top;
if($('#-header .-header-w').hasClass("fixed")){
_top = _top+70;
}
setTimeout(function () {
var newinit = $(document).scrollTop();
if ( newinit > jbOffset.top && $('#-header .-header-w').hasClass("fixed")) {
if($('#-header .-header-w').hasClass("fixed")){
_top = _top+70;
}
_top -= jbOffset.top;
var container_height = $("#container").height();
var quick_height = $(node).height();
var cul = container_height - quick_height;
if(_top > cul){
_top = cul+70;
}
//_top = _top + 50;
if(newinit >= container_height - 700){
_top = container_height - quick_height + 0;
$(node).stop().animate({top: _top}, options.animate);
}else{
$(node).stop().animate({top: _top}, options.animate);
}
} else if ( newinit <= jbOffset.top && $('#-header .-header-w').hasClass("fixed")) {
if($('#-header .-header-w').hasClass("fixed")){
_top = _top+70;
}
_top -= jbOffset.top;
var container_height = $("#container").height();
var quick_height = $(node).height();
var cul = container_height - quick_height;
if(_top > cul){
_top = cul+70;
}
//_top = _top + 50;
if(newinit >= container_height - 700){
_top = container_height - quick_height + 0;
$(node).stop().animate({top: _top}, options.animate);
}else{
$(node).stop().animate({top: _top}, options.animate);
}
}else{
// _top = 0; //header 7시리즈에서 이부분 주석처리
$(node).stop().animate({top: _top}, options.animate);
}
}, options.delay);
});
});
};
$.fn.floatBanner.defaults = {
'animate' : 500,
'delay' : 500
};
})(jQuery);
*/
/**
* hasClass
*/
function hasClass(element, className){
return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1;
};
/**
* toggle
*/
function toggleClassAll(element, handler, className){
var _handler = document.querySelector(handler);
document.querySelectorAll(handler).forEach(function(item){
item.addEventListener('click', function(){
var _element = item.parentNode;
$(this).toggleClass(className);
/*
if ( hasClass( _element, className ) ) {
_element.classList.remove( className );
} else {
_element.classList.add( className );
}
*/
})
})
};
/**
* findElements
*/
function findElements(element, findElement){
var resultElements = [];
document.querySelectorAll(element).forEach(function(item){
var findElementList = item.querySelectorAll(findElement);
findElementList = Array.prototype.slice.call(findElementList);
resultElements = resultElements.concat(findElementList);
})
return resultElements;
};
/**
* setAttributeAl
*/
function setAttributeAll(elements, name, value){
elements.forEach(function(item){
item.setAttribute(name, value);
})
};
/**
* 상품 섬네일 로드되지 않을 경우, 기본값 설정
*/
function setDefaultImage(element) {
document.querySelectorAll(element).forEach(function(item){
var $img = new Image();
$img.onerror = function () {
item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif";
}
$img.src = item.src;
});
};
/**
* tooltip
*/
function setTooltipEvent(){
var input = findElements('.eTooltip', 'input');
input.forEach(function(item){
item.addEventListener('focusin', function(event){
var targetName = returnTargetName(event.target);
targetName.nextElementSibling.style.display = 'block'
});
item.addEventListener('focusout', function(event){
var targetName = returnTargetName(event.target);
targetName.nextElementSibling.style.display = 'none'
});
});
}
/**
* tooltip input focus
*/
function returnTargetName(_this){
var ePlacename = _this.parentElement.getAttribute("class");
var targetName;
if(ePlacename == "ePlaceholder"){ //ePlaceholder supported
targetName = _this.parentElement;
}else{
targetName = _this;
}
return targetName;
}
/**
* 문서 구동후 시작
*/
$(document).ready(function(){
$('#banner:visible, #quick:visible').floatBanner();
});
/**
* window load
*/
window.addEventListener('load', function(){
if (document.querySelector('.thumbnail')){
setDefaultImage('.thumbnail img');
}
if (document.querySelector('.eTooltip')){
setAttributeAll(findElements('.eTooltip', '.btnClose'),'tabIndex','-1');
setTooltipEvent();
}
if (document.querySelector('div.eToggle')){
toggleClassAll(false, 'div.eToggle .title', 'selected');
}
});
jQuery(document).ready(function() {
/* 상단 고정 - 스크롤시 헤더top,bottom 보임(기본) */
var last_scrollTop = 0;
var header = document.getElementById("-header");
var headerTop = parseInt(header.offsetTop);
var mh_height = jQuery('header').innerHeight();
var sc = jQuery(window).scrollTop();
var headerTop = parseInt(header.offsetTop);
//console.log(sc +":"+ headerTop);
var promotionBanner = 0;
var headerTop2;
if(!$('body.-ckoff').length){
if(headerTop == 0){
promotionBanner = document.getElementById("promotionBanner").scrollHeight;
if(!promotionBanner){
promotionBanner = 50;
}
headerTop2 = promotionBanner;
}else{
headerTop2 = headerTop;
}
}else{
headerTop2 = 0;
}
if (sc > headerTop2) {
header.classList.add("fixed");
jQuery('.header_empty').css('height', mh_height);
// jQuery('header.fixed .-header-bottom').slideUp('fast');
}
jQuery(window).scroll(function() {
var sc = jQuery(window).scrollTop();
if(!$('body.-ckoff').length){
if(headerTop == 0){
promotionBanner = document.getElementById("promotionBanner").scrollHeight;
if(!promotionBanner){
promotionBanner = 50;
}
headerTop2 = promotionBanner;
}else{
headerTop2 = headerTop;
}
}else{
headerTop2 = 0;
}
// console.log("scroll"+headerTop2);
if (sc > headerTop2) {
header.classList.add("fixed");
jQuery('.header_empty').css('height', mh_height);
if (sc > last_scrollTop) {
//jQuery('header.fixed .-header-bottom').slideUp('fast');
} else {
//jQuery('header.fixed .-header-bottom').slideDown('fast');
}
} else {
header.classList.remove("fixed");
//jQuery('.-header-bottom').slideDown('fast');
}
last_scrollTop = sc;
});
});
function toggleClass(element, handler, className){
var _handler = document.querySelector(handler);
var _element = document.querySelector(element);
_handler.addEventListener('click', function(){
if ( _element.classList.contains(className) ) {
_element.classList.remove( className );
} else {
_element.classList.add( className );
}
});
}
function bottomNav(){
var lastScrollTop = 0;
var btnTop = document.querySelector('.bottom-nav__top');
var fixedButton = document.getElementById("orderFixArea");
if(fixedButton){
document.body.classList.add("button--fixed");
};
window.addEventListener("scroll", function(){
var scroll = window.pageYOffset || document.documentElement.scrollTop;
var nav = document.querySelector('.bottom-nav');
if (scroll > lastScrollTop){
nav.classList.add('bottom-nav--hide');
} else {
nav.classList.remove('bottom-nav--hide');
}
// scroll bottom
if(scroll === document.body.scrollHeight - document.documentElement.offsetHeight){
nav.classList.remove('bottom-nav--hide');
}
lastScrollTop = scroll <= 0 ? 0 : scroll;
// top button
var currentScrollPercentage = getCurrentScrollPercentage();
if(currentScrollPercentage > 30){
btnTop.classList.add('bottom-nav__top--show');
} else {
btnTop.classList.remove('bottom-nav__top--show');
}
});
btnTop.addEventListener('click', function(){
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});
}
function getOffset(element){
if (!element.getClientRects().length)
{
return { top: 0, left: 0 };
}
var rect = element.getBoundingClientRect();
var win = element.ownerDocument.defaultView;
return (
{
top: rect.top + win.pageYOffset,
left: rect.left + win.pageXOffset
});
}
function getQuickPosition(){
var role = document.querySelector("meta[name='path_role']").getAttribute('content');
if (role === "MAIN") {
return getMainQuickPosition();
} else {
return getSubQuickPosition();
}
}
function getMainQuickPosition(){
var quickMenu = document.querySelector('#quick');
var collection = document.querySelector('.collection');
var snsItem = document.querySelector('.snsItem');
var mainTopSpace = 115;
var mainFooterSpace = 34;
var top = collection.offsetTop + collection.clientHeight + mainTopSpace;
var footTop = getOffset(snsItem).top + mainFooterSpace;
var maxY = footTop - quickMenu.offsetHeight;
return [top, maxY]
}
function getSubQuickPosition(){
var quickMenu = document.querySelector('#quick');
var footer = document.querySelector("#footer");
var footerSpace = 60;
var top = 284;
var footTop = getOffset(footer).top;
var maxY = footTop - quickMenu.offsetHeight - footerSpace;
return [top, maxY]
}
function setQuickScrollEvent(y, quick){
var header = document.querySelector('#header');
var position = getQuickPosition();
var scrollY = y;
if (scrollY >= position[0] - header.offsetHeight){
if (scrollY < position[1]) {
quick.classList.add('fixed');
quick.removeAttribute('style');
} else {
quick.classList.remove('fixed');
quick.style.position = 'absolute';
quick.style.top = position[1] + 'px';
}
} else {
quick.style.top = position[0] + 'px';
quick.classList.remove('fixed');
}
}
function quickGoTop(){
var btnTop = document.querySelector('#quick .pageTop');
btnTop.addEventListener('click', function(){
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});
}
function topBanner(){
var banner = document.querySelector('#topBanner');
if(!banner) return;
var btnClose = banner.querySelector('.btnClose');
btnClose.addEventListener('click', function(){
banner.classList.add("hidden");
});
}
function getCurrentScrollPercentage(){
return (window.scrollY + window.innerHeight) / document.body.clientHeight * 100
}
jQuery(document).ready(function() {
jQuery("#header .inner .toparea .toparea_state .toparea_state_board").click(function() {
var theme_cl = jQuery(this).attr('class');
jQuery(this).toggleClass('on');
});
if (jQuery('.xans-member-login').val() != undefined) {
jQuery('#member_passwd').attr('placeholder', '비밀번호');
}
setTimeout(function(){
if (jQuery('.xans-myshop-orderhistorynologin').val() != undefined) {
jQuery('#order_name').attr('placeholder', '주문자명');
jQuery('#order_id').attr('placeholder', '주문번호(하이픈(-) 포함)');
jQuery('#order_password').attr('placeholder', '비회원주문 비밀번호');
}
}, 100);
/* 상단검색창 */
if (jQuery('.-log-search #keyword').val() != undefined) {
jQuery('.-log-search #keyword').attr('placeholder', 'Search');
}
jQuery('.-log-search #keyword').focus(function(){
jQuery(this).closest('fieldset').addClass("-on");
});
jQuery('.-log-search #keyword').blur(function(){
jQuery(this).closest('fieldset').removeClass("-on");
});
if (jQuery('.-sec2-search #keyword').val() != undefined) {
jQuery('.-sec2-search #keyword').attr('placeholder', 'Search');
jQuery('.-sec2-search #keyword').attr('autocomplete', 'off');
}
if (jQuery('.-searchForm #keyword').val() != undefined) {
jQuery('.-searchForm #keyword').attr('placeholder', 'Search');
}
if (jQuery('.bar-inner #keyword').val() != undefined) {
jQuery('.bar-inner #keyword').attr('placeholder', '검색어를 입력하세요');
jQuery('.bar-inner #keyword').attr('autocomplete', 'off');
}
jQuery('.bar-inner #keyword').focus(function(){
jQuery(this).parents('.searchbox_header.-s631b').addClass("-on");
});
jQuery('.bar-inner #keyword').blur(function(){
// jQuery(this).parents('.searchbox_header.-s631b').removeClass("-on");
});
/*
if (jQuery('#aside #banner_action').val() != undefined) {
var href = jQuery('#aside #banner_action').val();
jQuery('#aside #banner_action').val(href.replace('/product/list.html', '/roma/sub/list_construction.html'));
}
*/
/* 멀티샵 없을경우 숨김 */
jQuery(".xans-layout-multishoplist").each(function(){
var multishoplist_count = jQuery('li', this).length;
if ( multishoplist_count == 1 ) {
jQuery(this).hide();
}
});
/* 하단 에스크로 사용하면 출력 */
jQuery(".bt_escrow").each(function(){
var bt_escrow = jQuery(this).attr("data-ez-escrow");
if ( !bt_escrow == '' ) {
var bt_escrow_name = jQuery("a img[data-ez-escrow-id="+ bt_escrow +"]", this).addClass('on');
jQuery(this).css('display','block');
}
});
/* 로그인페이지 SNS 사용하면 출력 */
jQuery(".xans-member-login .login__sns .wrap_sns_log a").each(function(){
var wrap_sns_log = jQuery(this).hasClass('displaynone');
if( wrap_sns_log == false){
jQuery(".xans-member-login .login__sns").css('display','block');
}
});
/* 모바일에서 쇼핑큐레이션 */
jQuery('#shoppQbtn').click(function(){
if (jQuery("#searchContent.xans-product-searchdata").is(":hidden")) {
jQuery('#searchContent.xans-product-searchdata').slideDown('normal');
jQuery(this).text('상세검색 닫기');
jQuery(this).css('margin-top','0');
} else {
jQuery('#searchContent.xans-product-searchdata').slideUp('normal');
jQuery(this).text('상세검색');
}
});
/* 모바일에서 쇼핑큐레이션 없을시 버튼 숨김 */
jQuery("#searchContent").each(function(){
var prdCount_count = jQuery("#ec-searchdata-area", this).length;
if ( prdCount_count == '0' ) {
jQuery('#shoppQbtn').hide();
}
});
/* 마이페이지 나의게시글 없을때 메시지 표시 */
jQuery(".xans-myshop-boardpackage").each(function(){
var boardlist = jQuery(".xans-myshop-boardlist table", this).length;
if ( boardlist == '0' ) {
jQuery('.myshop_boardlist_empty').css('display','flex');
}
});
});
/* 우측퀵바 하단오면 멈추기 */
var filter = "win16|win32|win64|mac|macintel";
var device = "pc";
function checkOffset() {
if (navigator.platform) {
if (filter.indexOf(navigator.platform.toLowerCase()) < 0) {
device = "mobile";
}else{
var a = jQuery(document).scrollTop() + window.innerHeight;
var b = jQuery('#footer').offset().top;
if (a < b) {
jQuery('#right_quick').css('bottom', '');
} else {
jQuery('#right_quick').css('bottom', (30+(a-b))+'px');
}
}
}
if(jQuery(document).scrollTop() > 600){
jQuery('.header_bottom.header_full_width').addClass('bgon');
}else{
jQuery('.header_bottom.header_full_width').removeClass('bgon');
}
}
jQuery(document).ready(checkOffset);
jQuery(window).scroll(checkOffset);
/* 최상단배너 쿠키 스크립트 */
function setCookiem(cookie_name, cookie_value, expire_date) {
var today = new Date();
var expire = new Date();
expire.setTime(today.getTime() + 3600000 * 24 * expire_date);
cookies = cookie_name + '=' + cookie_value + '; path=/;';
if (expire_date != 0) cookies += 'expires=' + expire.toGMTString();
document.cookie = cookies;
}
function delCookiem(cookie_name) {
var _today = new Date();
var value = '';
_today.setDate(_today.getDate() - 1);
document.cookie = cookie_name + "=" + value + '; path=/;' + "; expires=" + _today.toGMTString();
}
function getCookiem(name) {
lims = document.cookie;
var index = lims.indexOf(name + "=");
if (index == -1) {
return null;
}
index = lims.indexOf("=", index) + 1; // first character
var endstr = lims.indexOf(';', index);
if (endstr == -1) {
endstr = lims.length; // last character
}
return unescape(lims.substring(index, endstr));
}
//window popup script
function winPop(url) {
window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no");
}
/**
* document.location.href split
* return array Param
*/
function getQueryString(sKey)
{
var sQueryString = document.location.search.substring(1);
var aParam = {};
if (sQueryString) {
var aFields = sQueryString.split("&");
var aField = [];
for(var i=0; i 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) { }
});
};
$(function(){
// tab
$.eTab = function(ul) {
$(ul).find('a').on('click', function() {
var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'),
_target = $(this).attr('href'),
_siblings = '.' + $(_target).attr('class');
$(_target).show().siblings(_siblings).hide();
return false
});
}
if ( window.call_eTab ) {
call_eTab();
};
globalBuyBtnScrollFunc();
});
$(function(){
if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") {
var sShippingCountryCode4Cookie = 'shippingCountryCode';
var bShippingCountryProc = false;
// 배송국가 선택 설정이 사용안함이면 숨김
if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) {
$('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide();
$('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide();
} else {
$('.thumb .xans-layout-multishoplistitem').hide();
var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)');
if (typeof(aShippingCountryCode) != 'undefined' && aShippingCountryCode != null && aShippingCountryCode.length > 2) {
var sShippingCountryValue = aShippingCountryCode[2];
}
// query string으로 넘어 온 배송국가 값이 있다면, 그 값을 적용함
var aHrefCountryValue = decodeURIComponent(location.href).split("/?country=");
if (aHrefCountryValue.length == 2) {
var sShippingCountryValue = aHrefCountryValue[1];
}
// 메인 페이지에서 국가선택을 안한 경우, 그 외의 페이지에서 셋팅된 값이 안 나오는 현상 처리
if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) {
$(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
$("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
}
}
if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) {
sShippingCountryValue = sShippingCountryValue.split("#")[0];
var bShippingCountryProc = true;
$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
$(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
var expires = new Date();
expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
$("#f_country").val(sShippingCountryValue).change();
}
}
}
// 언어선택 설정이 사용안함이면 숨김
if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) {
$('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide();
$('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide();
} else {
$('.thumb .xans-layout-multishoplistitem').hide();
}
// 배송국가 및 언어 설정이 둘 다 사용안함이면 숨김
if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) {
$(".xans-layout-multishopshipping").hide();
$('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide();
} else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // 배송국가 값을 처리한 적이 없고, 메인화면일 때만 선택 레이어를 띄움
var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val();
$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
$(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
// 배송국가 선택을 사용해야 레이어를 보이게 함
if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) {
$(".xans-layout-multishopshipping").show();
}
}
$(".xans-layout-multishopshipping .btnClose").on("click", function() {
$(".xans-layout-multishopshipping").hide();
});
$(".xans-layout-multishopshipping .ec-base-button a").on("click", function() {
var expires = new Date();
expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
// 도메인 문제로 쿠키로 배송국가 설정이 안 되는 경우를 위해 query string으로 배송국가 값을 넘김
var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting;
});
$(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").on("click", function() {
$(".xans-layout-multishopshipping").show();
});
}
});
document.addEventListener('DOMContentLoaded', function() {
var $scope = $(".dnd_module_9742c60d3a2ee81fffada3eade8d931d");
$scope.find('.headerMenu .btnSearch').unbind('click.btnSearch').bind('click.btnSearch', function () {
var $header = $(this).closest('#header');
$header.addClass('open');
$header.find('#dimmedSlider').one("click", function () {
$header.removeClass('open');
});
});
$('.xans-layout-searchheader').find('button.btnDelete').unbind('click.btnDelete').bind('click.btnDelete', function () {
$('.topSearch').find('input#keyword').attr('value', '').focus();
});
});
(function() {
function pageLoaded(){
var $scope = $(".header_top_bottom_holder");
//$(".-header").height($scope.outerHeight(true));
}
function dndComponent() {
var $scope = $(".dnd_module_c785e267507864e0f86dfc2033986f74");
var calculateNavigationCategoryTimer = null,
//$navigation = $scope.find("#navigation");
$navigation = $("#navigation");
function calculateNavigationCategory() {
var $navigationCategory = $("#navigation > .inner .-navigationCategory"), //통합
//var $navigationCategory = $("#navigation > .inner .category"), //header7_2.html
//var $navigationCategory = $("#navigation > .inner .lc7-d1-wrap"), //header7_22.html
$categoryChild = $navigationCategory.children(),
calculate = 0;
if(!$navigationCategory.length) return;
$categoryChild.each( function( idx ) {
calculate = calculate + $(this).outerWidth(true) + parseInt( $( this ).css('marginLeft'),10 );
} );
if( $navigationCategory.width() < calculate + 50 ) {
$("#navigation").addClass('isShort');
} else {
$("#navigation").removeClass('isShort');
}
}
if( $navigation.length ) {
$(window).bind('resize.calculateNavigationCategory', function() {
if(calculateNavigationCategoryTimer) clearTimeout( calculateNavigationCategoryTimer );
calculateNavigationCategoryTimer = setTimeout(calculateNavigationCategory, 100);
}).trigger("resize.calculateNavigationCategory");
}
$scope.find('.eToggleCateLayer').click(function () {
$scope.find('> nav').toggleClass('open');
$('.navDimmed').toggleClass('show');
});
}
if (document.readyState == 'complete') {
dndComponent();
} else {
document.addEventListener('DOMContentLoaded', dndComponent);
document.addEventListener('DOMContentLoaded', pageLoaded);
}
})();
/**
* 모바일쇼핑몰 슬라이딩메뉴
offCover는 /gridsystem/resource/js/common.js */
var aCategory = [];
$(document).ready(function(){
//$('.main-header').append('');
var methods = {
aCategory : [],
aSubCategory : {},
get: function()
{
$.ajax({
url : '/exec/front/Product/SubCategory',
dataType: 'json',
success: function(aData) {
if (aData == null || aData == 'undefined') {
methods.checkSub();
return;
}
for (var i=0; i