I did the same thing with my quote generator (re: Array). Also, in the Beta version, they didn’t give us any clue as to a quote API, and I preferred hunting down quotes myself.
So, there’s this concept in computing called “event-oriented programming,” in which the coder writes functions to deal with UI events. HTML/JS has this functionality built in:
<div onclick="myClickEventHandler()"></div>, for example. The DOM, JS’s virtual representation of the document, has events things like “the window and all its components have finished loading”. By setting
window.onload = initialBehaviorIWant();, you “hang” the behavior coded in the “initialBehaviorIWant” functionality (the event handler function) on the “hook” of the event.
However, since you don’t want your user to feel rushed, and to miss your pretty hero image, you don’t want to trigger a scroll immediately on load. It’d be better if the hero image stuck around for enough time for them to peruse it, then got itself neatly out of the way without any user intervention. For this, you need to delay the “initialBehaviorIWant()” call, and you do this with setTimeout().