A Javascript function that creates custom events whenever percentages of a page has been viewed or elements enter the viewport