var body; var window_height = $(window).height(); $(function() { body = $("body"); if(isFrontEnv()) { $("img[lazy-src]").each(function() { $(this).attr("src", $(this).attr("lazy-src")).removeAttr("lazy-src"); }); body.addClass("wd"); setTimeout(function() { index(); body.addClass("w-loaded"); }, 2000); } else { body.addClass("make"); } }); function lazy(a, c) { var timer = setInterval(function() { var b = $(a); if (b.length) { clearInterval(timer); c(b); } }, 100); } function sub() { body.addClass("sub"); var anis = $("div[id^=w_common_text-], div[id^=w_fline-], div[id^=w_fimg-], div[id^=c_portalResProduct_list-] .p_Product, div[id^=c_portalResProduct_category-], div[id^=c_portalResNews_list-]").addClass("w-scroll-ani"); function scroll_handle() { var t = $(window).scrollTop(); anis.each(function() { var top = $(this).offset().top; if(top < (window_height + t - 30)) { $(this).addClass("scrolled"); anis = anis.not($(this)); } }); if(window_height + t == body.height()) { $(".w-scroll-ani:not(.scrolled)").each(function() { var top = $(this).offset().top; if(top > (body.height() - window_height)) { $(this).addClass("scrolled"); anis = anis.not($(this)); } }); } } $(window).scroll(function() { scroll_handle(); }); scroll_handle(); } function index() { var anis = [$("#c_portalResPublic_codeContainer-15869171229449975")]; anis.push($("#c_portalResPublic_codeContainer-15870151457849482")); anis.push($("#w_fimg-1586916846112")); anis.push($("#c_portalResComplaintPage_detail-15870073424869628")); anis.push($("#w_fimg-1587021796291")); anis.push($("#w_grid-1586838222537")); anis.push($("#c_portalResPublic_codeContainer-15869155417898001")); anis.push($("#w_fimgbox-1587099908911")); anis.push($("#w_common_text-1586838223027")); anis.push($("#w_common_text-1586838223032")); anis.push($("#w_grid-1586838222587")); anis.push($("#c_portalResNews_list-15870269453478791")); anis.push($("#w_grid-1586838222897")); $.each(anis, function(i,v) { v.addClass("w-scroll-ani"); }); function handle() { var t = $(window).scrollTop(); var w = $(".w-scroll-ani:not(.scrolled)"); w.each(function() { var top = $(this).offset().top; if(top < (window_height + t - 100)) { $(this).addClass("scrolled"); } }); if(window_height + t == body.height()) { $(".w-scroll-ani:not(.scrolled)").each(function() { var top = $(this).offset().top; if(top > (body.height() - window_height)) { $(this).addClass("scrolled"); } }); } } $(window).scroll(function() { handle(); }); handle(); }