properly bind javascript events

后端 未结 4 1535
无人共我
无人共我 2020-12-05 14:47

I am looking for the most proper and efficient way to bind javascript events; particularly the onload event (I would like the event to occur after b

4条回答
  •  春和景丽
    2020-12-05 15:33

    Something like that

    window.onload = (function(onload) {
        return function(event) {
            onload && onload(event);
    
            $(".loading-overlay .spinner").fadeOut(300),
                $(".loading-overlay").fadeOut(300);
                $("body").css({
                    overflow: "auto",
                    height: "auto",
                    position: "relative"
                })
        }
    }(window.onload));
    

提交回复
热议问题