I have a page that scrolls horizontally left to right. As the user completes the form, the page is scrolled to the left to show the next part of the form. This is no problem with jQuery. The problem is that I want to have the option to have the parent page jump to a specific subpage of the form. If my code were vertical, this could be easily done with hashtags. The only other way that I can think of is to pass a GET variable in the querystring and then echo the GET variable to a javascript variable and move the page that way. Is there a better way?
var subpage = '<?php echo $_GET['subpage'] ?>';
if (subpage == 'yes') {
$('#page_wrapper').css('left', '-2000px');
}
You can still do it with hashtags:
Also you probably want to use scrollLeft to set the horizontal scroll of the page, if you do it the way you’re doing it there you’ll run some of the page outside of the viewport.