File: /www/wwwroot/www.scdc-marine.com/wp-content/themes/scdc-marine/assets/js/asd.js
function dropdown_page() {
let t = null
, e = new Date
, n = 1e3;
$(window).on("scroll", function() {
t && clearTimeout(t);
let o = new Date
, s = ()=>{
let t = $(".ly_product_list_1 .list_box")
, e = $(this).scrollTop()
, n = $(this).height()
, o = t[0].scrollHeight
, s = 120;
if (o - (e + n) < s) {
let e = $("#dropdown_page")
, n = parseInt(e.attr("page"))
, o = parseInt(e.attr("max-page"));
parseInt(e.attr("mobile"));
if (n < o) {
$(".dropdown_loading").loading(),
n += 1,
e.attr("page", n);
let o = {
page: n
}
, s = window.location.search;
$.ajax({
url: s,
async: !0,
type: "get",
data: o,
dataType: "html",
success: function(e) {
$(".dropdown_loading").unloading();
let n = $(e)
, o = n.find(".list_box")
, s = o.find(".themes_prod");
s.length > 0 && t.append(s)
}
})
}
}
}
;
o - e >= n ? (s(),
e = o) : t = setTimeout(s, 300)
})
}
function mobile_select_category(t, e) {
t.on("click", function() {
if (!t.length || !e.length || $(window).width() > 1e3)
return !1;
let n = t.hasClass("cur")
, o = t.offset().top + 5
, s = t.outerHeight();
n ? $(this).removeClass("cur") : $(this).addClass("cur"),
n ? e.hide() : e.show(),
e.css("top", o + s);
let a = "sticky";
(e.hasClass("has_wrapper_screening") && !n || $(window).width() <= 1e3) && (a = "absolute"),
e.css("position", a)
})
}
function left_category_click(t) {
t && t.on("click", "i", function() {
let t = $(this)
, e = !!t.hasClass("cur");
e ? t.removeClass("cur").parent().next().slideUp() : t.addClass("cur").parent().next().slideDown()
})
}
$(function(){
dropdown_page();
mobile_select_category($('.ly_product_list_1[data-visual-id="5831"] .list_wrapper .top_title'), $('.ly_product_list_1[data-visual-id="5831"] .products_category_wrapper'));
left_category_click($('.ly_product_list_1[data-visual-id="5831"] .category_box'));
})