convert a jQuery code to a pure JavaScript -
i'm trying convert jquery code pure javascript , i'm stuck @ :
$(window).on({ resize: somefunction, scroll: someotherfunction }).trigger("resize").trigger("scroll")
any hints ?
adding event handlers can done follows:
window.onresize = somefunction; document.body.onscroll = someotherfunction;
triggering events little more complex. can see jquery source trigger() on github
Comments
Post a Comment