$(function () { setTimeout(function () { initWrapperTop(true)}, 150); $(".zoushi-category-item").click(function () { let type = $(this).find('span').data('code'); if (type == 'DFC' || type == 'QGC') { $('#gpc').hide(); initWrapperTop(false); } else { $('#gpc').show(); initWrapperTop(true); } $(this).addClass("zoushi-active").siblings(".zoushi-category-item").removeClass("zoushi-active"); var load = layer.load(2, { shade: [0.1, '#000'] }); //$("#zsList").load('@(Url.Action("ZSList", "ZS", null, Request.Url.Scheme))', { t: type }, function () { // layer.close(load); //}); $.ajax({ url: "/ZS/ZSList", type: "post", async: false, data: { t: type }, success: function (res) { layer.close(load); if (res != "") { thisPageIndex = 1; $("#zsList").html(res); } else { layer.msg("没有更多数据了!") } }, error: function (err) { console.log(err) layer.close(load); } }) }) }) function initWrapperTop(gpc) { $("#ads-wrapper").show(); var h1 = $("#ads-wrapper").height(); var h = h1 + 43; if (gpc) { h = h + 40; } $("#wrapper1").css({top:h+"px"}) }