Sorry...can't show any significant code because it is too deeply buried within an app but I think I can describe the problem easily. I have a 2 page form that has a large amount of content on page 1 and just a very small amount on page 2. Switching to page 2 is handled by the following:
$('#B2').on('click', function () {
if ($('#page1').valid()) {
// code to show page 2
$('#page1').hide();
$('#page2').show();
All works very well except that when the user is presented page 2 it is very far down the page...the same "relative spot" as they were on with page 1 but it seems to the user as if they are seeing a blank page. If they scroll up they will eventually see the page 2 content. I want to somehow force this window scroll. (Another little "gotcha" is that all of this is in a "wrapped" container within a CMS.) The only thing that seems to work is to actually press the up arrow several times or scroll the mouse wheel.
I have tried to add each of the following lines (individually) immediately after the $('#page2').show();
window.scrollBy(0,-400);
window.scrollTo(0,0);
Any ideas as to what else I can try?