$(function(){ scrollani(); if ($(".warp-subnav").length >= 1) { $("").css("box-shadow","none"); } if ($(".warp-subnav").length >= 1) { var _this = $(".warp-subnav").offset().top - $("header").height() + $(".warp-subnav").height(); $(window).scroll(function() { if ($(window).scrolltop() > _this){ $(".subnav").addclass("active"); $(".subnav").css("top",0); $("header").addclass("active"); }else{ $(".subnav").removeclass("active"); $(".subnav").css("top",0); $("header").removeclass("active"); } }); }; $(".warp-buy").hover(function(){ $(this).addclass("cur"); },function(){ $(this).removeclass("cur"); }) $(".nav .li").removeclass("animate"); $(".hamburger").on("click",function(){ if ($(this).hasclass("is-active")) { $(this).removeclass("is-active"); $("body,html").removeclass("ovh-f"); $(".warp-nav li").removeclass("animate"); settimeout(function(){ $(".warp-nav").stop(true,false).fadeout(200); },200) }else{ $(this).addclass("is-active"); $("body,html").addclass("ovh-f"); $(".warp-nav").stop(true,false).fadein(200); $(".warp-nav li").addclass("animate"); } }) $(".sub-menu .sub-tit").on('click', function() { if ($(this).siblings('.sec-list').is(':hidden')){ $(this).addclass('on'); $(this).siblings('.sec-list').stop().slidedown(); $(this).parent().siblings('li').children('.sec-list').stop().slideup().siblings('.tit').removeclass('on'); }else{ $(this).removeclass('on'); $(this).siblings('.sec-list').stop().slideup(); } }); var _id = geturlparam("id"); if (_id == 1) { $("html,body").animate({"scrolltop":$(".n-banner").height()+1}, 700); } // $(".z-st-menu li").on("click",function(){ // if ($(this).hasclass("cur")) { // $(this).removeclass("cur"); // $(this).find(".li-nav").stop(true,false).slideup(); // }else{ // $(this).addclass("cur").siblings().removeclass("cur"); // $(this).find(".li-nav").stop(true,false).slidedown().parents("li").siblings().find(".li-nav").stop(true,false).slideup(); // } // }) }); function scrollani() { $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrolltop() + $(window).height() || _this.offset().top < $(window).scrolltop() - _this.outerheight()) { // _this.removeclass('animate'); } else if ($(window).scrolltop() > _this.offset().top - $(window).height() * 0.95) { _this.addclass('animate'); } }); $(window).scroll(function() { $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrolltop() + $(window).height() || _this.offset().top < $(window).scrolltop() - _this.outerheight()) { // _this.removeclass('animate'); } else if ($(window).scrolltop() > _this.offset().top - $(window).height() * 0.95) { _this.addclass('animate'); // $(_this) // startscramble('.i-img-list.animate .home-dec'); // startscramble('.i-lista.animate .home-dec'); } }); }); } /* var _id = geturlparam("id"); if (_id == 6) { alert(0); } */ function geturlparam(name){ var reg = new regexp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r!=null) return unescape(r[2]); return null; }