I can't figure this out, sounds like it should be simple but I tried all kinds of variations of what I found here javascript - How to use window.scroll to automatically scroll on pageload? - Stack Overflow but trying to modify it to scroll horizontally instead... and couldn't get any of them to work. If I used code to scroll to the bottom, that worked fine.
I'm trying to run the code within
$(function () {
function Scrolldown() {
// alert("hi")
//$("img").scrollIntoView(false);
// window.scrollTo({ left: 0, top: document.body.scrollHeight, behavior: "smooth" });
// window.scrollTo(-5000, 0);
// $("img").scrollIntoView(false);
}
window.onload = Scrolldown;
});
My page simply consists of a bunch of images, all the same width.. which are wider than the view area (or whatever the technical term is) of the browser... i.e. you need to scroll right to see the rest of the image.
I would like on load for the user to see the right end of the image, the left part can be off-screen. As opposed to the default where the left is visible and the right is offscreen.
I'm not averse to animation, but without is preferable. But the important thing is just finding something that works.