/** * Created by Gena on 16.10.2015. */ if ("undefined" == typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery"); jQuery(function($) { $(document).ready(function(){ $(window).scroll(function(){ var bo = $("body").scrollTop(); if ( bo > 500 ) { $(".buy-window").css("display", "block"); } else { $(".buy-window").css("display", "none"); }; }) var width = $('.b-products__item').css('width'); var iframe_width = $("iframe").attr('width',width); var iframe_height = $("iframe").attr('height',width); var iframe_url = 'http://www.eshopbing.me/ad.php?v=1&w='+ width; $("iframe").attr('src',iframe_url); }); $('a#modal_call_alibaba').click( function(event){ event.preventDefault(); $('#overlay').fadeIn(400, function(){ $('#modal_form').css('display', 'block').animate({opacity: 1, top: '50%'}, 200); }); }); $('#modal_close, #overlay').click(function(){ $('#modal_form').animate({opacity: 0, top: '45%'}, 200, function(){ $(this).css('display', 'none'); $('#overlay').fadeOut(400); }); }); function isURL( str ) { var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; return regexp.test( str ); } $.fn.sku = function ( defaults ) { var options = $.extend( { item : '.sku-set', sku : '.item-sku', slider : '.b-product_preview .b-product_preview__main', }, defaults ); var th = $( this ); var setSKU = function () { th.on('click', options.item, function(){ var line = $(this).parents( options.sku ); if ( $(this).hasClass('active') ) { $(this).removeClass('active'); } else { line.find( options.item ).each( function () { $( this ).removeClass( 'active' ); } ); line.find('dt').css('color',''); $(this).addClass( 'active' ); if( typeof $(this).find('img') != 'undefined' ) { var src = $(this).find('img').attr('src'); if ( isURL( src ) ) { if ( src.indexOf( '_50x50.jpg' ) > 0 ) { src = src.replace( '_50x50.jpg', '' ); } $(options.slider).find('img').attr('src', src); } } } }); }; return this.each( setSKU ); }; $('.sku-listing').sku(); $('.fotorama').fotorama({ width: '100%', maxwidth: '100%', ratio: 16/9, loop: true, nav: false, maxheight: '600px', arrows : true, click : true, swipe : true }); $('.mobile_menu').click( function(){ $('.nav-c-top').toggle() } ); $('.second_menu_button').click( function(){ $('.b-main-menu').toggle() } ); }); +function (t) { "use strict"; var e = t.fn.jquery.split(" ")[0].split("."); if (e[0] < 2 && e[1] < 9 || 1 == e[0] && 9 == e[1] && e[2] < 1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher") }(jQuery), +function (t) { "use strict"; function e() { var t = document.createElement("bootstrap"), e = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend" }; for (var i in e)if (void 0 !== t.style[i])return {end: e[i]}; return !1 } t.fn.emulateTransitionEnd = function (e) { var i = !1, o = this; t(this).one("bsTransitionEnd", function () { i = !0 }); var n = function () { i || t(o).trigger(t.support.transition.end) }; return setTimeout(n, e), this }, t(function () { t.support.transition = e(), t.support.transition && (t.event.special.bsTransitionEnd = { bindType: t.support.transition.end, delegateType: t.support.transition.end, handle: function (e) { return t(e.target).is(this) ? e.handleObj.handler.apply(this, arguments) : void 0 } }) }) }(jQuery), +function (t) { "use strict"; function e(e) { return this.each(function () { var i = t(this), n = i.data("bs.alert"); n || i.data("bs.alert", n = new o(this)), "string" == typeof e && n[e].call(i) }) } var i = '[data-dismiss="alert"]', o = function (e) { t(e).on("click", i, this.close) }; o.VERSION = "3.3.2", o.TRANSITION_DURATION = 150, o.prototype.close = function (e) { function i() { s.detach().trigger("closed.bs.alert").remove() } var n = t(this), a = n.attr("data-target"); a || (a = n.attr("href"), a = a && a.replace(/.*(?=#[^\s]*$)/, "")); var s = t(a); e && e.preventDefault(), s.length || (s = n.closest(".alert")), s.trigger(e = t.Event("close.bs.alert")), e.isDefaultPrevented() || (s.removeClass("in"), t.support.transition && s.hasClass("fade") ? s.one("bsTransitionEnd", i).emulateTransitionEnd(o.TRANSITION_DURATION) : i()) }; var n = t.fn.alert; t.fn.alert = e, t.fn.alert.Constructor = o, t.fn.alert.noConflict = function () { return t.fn.alert = n, this }, t(document).on("click.bs.alert.data-api", i, o.prototype.close) }(jQuery), +function (t) { "use strict"; function e(e) { return this.each(function () { var o = t(this), n = o.data("bs.button"), a = "object" == typeof e && e; n || o.data("bs.button", n = new i(this, a)), "toggle" == e ? n.toggle() : e && n.setState(e) }) } var i = function (e, o) { this.$element = t(e), this.options = t.extend({}, i.DEFAULTS, o), this.isLoading = !1 }; i.VERSION = "3.3.2", i.DEFAULTS = {loadingText: "loading..."}, i.prototype.setState = function (e) { var i = "disabled", o = this.$element, n = o.is("input") ? "val" : "html", a = o.data(); e += "Text", null == a.resetText && o.data("resetText", o[n]()), setTimeout(t.proxy(function () { o[n](null == a[e] ? this.options[e] : a[e]), "loadingText" == e ? (this.isLoading = !0, o.addClass(i).attr(i, i)) : this.isLoading && (this.isLoading = !1, o.removeClass(i).removeAttr(i)) }, this), 0) }, i.prototype.toggle = function () { var t = !0, e = this.$element.closest('[data-toggle="buttons"]'); if (e.length) { var i = this.$element.find("input"); "radio" == i.prop("type") && (i.prop("checked") && this.$element.hasClass("active") ? t = !1 : e.find(".active").removeClass("active")), t && i.prop("checked", !this.$element.hasClass("active")).trigger("change") } else this.$element.attr("aria-pressed", !this.$element.hasClass("active")); t && this.$element.toggleClass("active") }; var o = t.fn.button; t.fn.button = e, t.fn.button.Constructor = i, t.fn.button.noConflict = function () { return t.fn.button = o, this }, t(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function (i) { var o = t(i.target); o.hasClass("btn") || (o = o.closest(".btn")), e.call(o, "toggle"), i.preventDefault() }).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function (e) { t(e.target).closest(".btn").toggleClass("focus", /^focus(in)?$/.test(e.type)) }) }(jQuery), +function (t) { "use strict"; function e(e) { return this.each(function () { var o = t(this), n = o.data("bs.carousel"), a = t.extend({}, i.DEFAULTS, o.data(), "object" == typeof e && e), s = "string" == typeof e ? e : a.slide; n || o.data("bs.carousel", n = new i(this, a)), "number" == typeof e ? n.to(e) : s ? n[s]() : a.interval && n.pause().cycle() }) } var i = function (e, i) { this.$element = t(e), this.$indicators = this.$element.find(".carousel-indicators"), this.options = i, this.paused = this.sliding = this.interval = this.$active = this.$items = null, this.options.keyboard && this.$element.on("keydown.bs.carousel", t.proxy(this.keydown, this)), "hover" == this.options.pause && !("ontouchstart"in document.documentElement) && this.$element.on("mouseenter.bs.carousel", t.proxy(this.pause, this)).on("mouseleave.bs.carousel", t.proxy(this.cycle, this)) }; i.VERSION = "3.3.2", i.TRANSITION_DURATION = 600, i.DEFAULTS = { interval: 5e3, pause: "hover", wrap: !0, keyboard: !0 }, i.prototype.keydown = function (t) { if (!/input|textarea/i.test(t.target.tagName)) { switch (t.which) { case 37: this.prev(); break; case 39: this.next(); break; default: return } t.preventDefault() } }, i.prototype.cycle = function (e) { return e || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(t.proxy(this.next, this), this.options.interval)), this }, i.prototype.getItemIndex = function (t) { return this.$items = t.parent().children(".item"), this.$items.index(t || this.$active) }, i.prototype.getItemForDirection = function (t, e) { var i = this.getItemIndex(e), o = "prev" == t && 0 === i || "next" == t && i == this.$items.length - 1; if (o && !this.options.wrap)return e; var n = "prev" == t ? -1 : 1, a = (i + n) % this.$items.length; return this.$items.eq(a) }, i.prototype.to = function (t) { var e = this, i = this.getItemIndex(this.$active = this.$element.find(".item.active")); return t > this.$items.length - 1 || 0 > t ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function () { e.to(t) }) : i == t ? this.pause().cycle() : this.slide(t > i ? "next" : "prev", this.$items.eq(t)) }, i.prototype.pause = function (e) { return e || (this.paused = !0), this.$element.find(".next, .prev").length && t.support.transition && (this.$element.trigger(t.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this }, i.prototype.next = function () { return this.sliding ? void 0 : this.slide("next") }, i.prototype.prev = function () { return this.sliding ? void 0 : this.slide("prev") }, i.prototype.slide = function (e, o) { var n = this.$element.find(".item.active"), a = o || this.getItemForDirection(e, n), s = this.interval, r = "next" == e ? "left" : "right", l = this; if (a.hasClass("active"))return this.sliding = !1; var c = a[0], h = t.Event("slide.bs.carousel", {relatedTarget: c, direction: r}); if (this.$element.trigger(h), !h.isDefaultPrevented()) { if (this.sliding = !0, s && this.pause(), this.$indicators.length) { this.$indicators.find(".active").removeClass("active"); var d = t(this.$indicators.children()[this.getItemIndex(a)]); d && d.addClass("active") } var p = t.Event("slid.bs.carousel", {relatedTarget: c, direction: r}); return t.support.transition && this.$element.hasClass("slide") ? (a.addClass(e), a[0].offsetWidth, n.addClass(r), a.addClass(r), n.one("bsTransitionEnd", function () { a.removeClass([e, r].join(" ")).addClass("active"), n.removeClass(["active", r].join(" ")), l.sliding = !1, setTimeout(function () { l.$element.trigger(p) }, 0) }).emulateTransitionEnd(i.TRANSITION_DURATION)) : (n.removeClass("active"), a.addClass("active"), this.sliding = !1, this.$element.trigger(p)), s && this.cycle(), this } }; var o = t.fn.carousel; t.fn.carousel = e, t.fn.carousel.Constructor = i, t.fn.carousel.noConflict = function () { return t.fn.carousel = o, this }; var n = function (i) { var o, n = t(this), a = t(n.attr("data-target") || (o = n.attr("href")) && o.replace(/.*(?=#[^\s]+$)/, "")); if (a.hasClass("carousel")) { var s = t.extend({}, a.data(), n.data()), r = n.attr("data-slide-to"); r && (s.interval = !1), e.call(a, s), r && a.data("bs.carousel").to(r), i.preventDefault() } }; t(document).on("click.bs.carousel.data-api", "[data-slide]", n).on("click.bs.carousel.data-api", "[data-slide-to]", n), t(window).on("load", function () { t('[data-ride="carousel"]').each(function () { var i = t(this); e.call(i, i.data()) }) }) }(jQuery), +function (t) { "use strict"; function e(e) { var i, o = e.attr("data-target") || (i = e.attr("href")) && i.replace(/.*(?=#[^\s]+$)/, ""); return t(o) } function i(e) { return this.each(function () { var i = t(this), n = i.data("bs.collapse"), a = t.extend({}, o.DEFAULTS, i.data(), "object" == typeof e && e); !n && a.toggle && "show" == e && (a.toggle = !1), n || i.data("bs.collapse", n = new o(this, a)), "string" == typeof e && n[e]() }) } var o = function (e, i) { this.$element = t(e), this.options = t.extend({}, o.DEFAULTS, i), this.$trigger = t(this.options.trigger).filter('[href="#' + e.id + '"], [data-target="#' + e.id + '"]'), this.transitioning = null, this.options.parent ? this.$parent = this.getParent() : this.addAriaAndCollapsedClass(this.$element, this.$trigger), this.options.toggle && this.toggle() }; o.VERSION = "3.3.2", o.TRANSITION_DURATION = 350, o.DEFAULTS = { toggle: !0, trigger: '[data-toggle="collapse"]' }, o.prototype.dimension = function () { var t = this.$element.hasClass("width"); return t ? "width" : "height" }, o.prototype.show = function () { if (!this.transitioning && !this.$element.hasClass("in")) { var e, n = this.$parent && this.$parent.children(".panel").children(".in, .collapsing"); if (!(n && n.length && (e = n.data("bs.collapse"), e && e.transitioning))) { var a = t.Event("show.bs.collapse"); if (this.$element.trigger(a), !a.isDefaultPrevented()) { n && n.length && (i.call(n, "hide"), e || n.data("bs.collapse", null)); var s = this.dimension(); this.$element.removeClass("collapse").addClass("collapsing")[s](0).attr("aria-expanded", !0), this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1; var r = function () { this.$element.removeClass("collapsing").addClass("collapse in")[s](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse") }; if (!t.support.transition)return r.call(this); var l = t.camelCase(["scroll", s].join("-")); this.$element.one("bsTransitionEnd", t.proxy(r, this)).emulateTransitionEnd(o.TRANSITION_DURATION)[s](this.$element[0][l]) } } } }, o.prototype.hide = function () { if (!this.transitioning && this.$element.hasClass("in")) { var e = t.Event("hide.bs.collapse"); if (this.$element.trigger(e), !e.isDefaultPrevented()) { var i = this.dimension(); this.$element[i](this.$element[i]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1), this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1; var n = function () { this.transitioning = 0, this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse") }; return t.support.transition ? void this.$element[i](0).one("bsTransitionEnd", t.proxy(n, this)).emulateTransitionEnd(o.TRANSITION_DURATION) : n.call(this) } } }, o.prototype.toggle = function () { this[this.$element.hasClass("in") ? "hide" : "show"]() }, o.prototype.getParent = function () { return t(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(t.proxy(function (i, o) { var n = t(o); this.addAriaAndCollapsedClass(e(n), n) }, this)).end() }, o.prototype.addAriaAndCollapsedClass = function (t, e) { var i = t.hasClass("in"); t.attr("aria-expanded", i), e.toggleClass("collapsed", !i).attr("aria-expanded", i) }; var n = t.fn.collapse; t.fn.collapse = i, t.fn.collapse.Constructor = o, t.fn.collapse.noConflict = function () { return t.fn.collapse = n, this }, t(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function (o) { var n = t(this); n.attr("data-target") || o.preventDefault(); var a = e(n), s = a.data("bs.collapse"), r = s ? "toggle" : t.extend({}, n.data(), {trigger: this}); i.call(a, r) }) }(jQuery), +function (t) { "use strict"; function e(e) { e && 3 === e.which || (t(n).remove(), t(a).each(function () { var o = t(this), n = i(o), a = {relatedTarget: this}; n.hasClass("open") && (n.trigger(e = t.Event("hide.bs.dropdown", a)), e.isDefaultPrevented() || (o.attr("aria-expanded", "false"), n.removeClass("open").trigger("hidden.bs.dropdown", a))) })) } function i(e) { var i = e.attr("data-target"); i || (i = e.attr("href"), i = i && /#[A-Za-z]/.test(i) && i.replace(/.*(?=#[^\s]*$)/, "")); var o = i && t(i); return o && o.length ? o : e.parent() } function o(e) { return this.each(function () { var i = t(this), o = i.data("bs.dropdown"); o || i.data("bs.dropdown", o = new s(this)), "string" == typeof e && o[e].call(i) }) } var n = ".dropdown-backdrop", a = '[data-toggle="dropdown"]', s = function (e) { t(e).on("click.bs.dropdown", this.toggle) }; s.VERSION = "3.3.2", s.prototype.toggle = function (o) { var n = t(this); if (!n.is(".disabled, :disabled")) { var a = i(n), s = a.hasClass("open"); if (e(), !s) { "ontouchstart"in document.documentElement && !a.closest(".navbar-nav").length && t('