var subScript = (function(){ return { gnbEvt : function(){ //search $(".utils .btnSearch").on("click", function(){ $(".utils .headerSearch").show(); TweenMax.to($(".utils .headerSearch"), 0.4, {top:0, ease:Circ.easeOut}); }); $(".utils .headerSearch .btnClose").on("click", function(){ TweenMax.to($(".utils .headerSearch"), 0.4, {top:"-60%", ease:Circ.easeOut, onComplete : function(){ $(".utils .headerSearch").hide(); }}); }); }, } })(); $(window).load(function(){ if(isAgentChk) { //mobile device subScript.gnbEvt(); } else { //web subScript.gnbEvt(); } }) var isAgentChk; if(navigator.userAgent.indexOf('Mobile') != -1){ //mobile isAgentChk = true; } else { //pc isAgentChk = true; }