var hsm={};hsm.init=function(){hsm.events()};hsm.events=function(){hsm.common()}; hsm.common = function () { $(window).scroll(function() { var header = $(".header"); $(window).scrolltop() > header.height() ? header.addclass("cur") : header.removeclass("cur"); }); } $(function () { hsm.init(); });