Intention: Automatically scroll the window to the top of a DOM element when the document is loaded.
via JavaScript:
window.onload = function(){
document.getElementById('foo').scrollIntoView(true);
};
Questions and Concerns:
- Is there a more compact and/or smarter technique?
- Does this technique pose issues or potential conflicts?
- With the above said, should it matter where on the document it's loaded? If so, what's the best location? I've already studied this question and its references closely and I'm led to believe it's best to have this kind of script located toward the bottom the document.