2012年3月24日土曜日

Returning Focus to the top of the page

I have two panels over laying each other. When the user click a button at the bottom of the first panel, that disappears and the panel on top appears, when the event triggers and the Ajax response is processed the page focus remains where the button that was clicked once was and as the information on the second panel is at the top of the page, the user has to scroll up to the top each time. This is obivously something to do with Ajax, but I can't get the page to return to the top. I have tryed using a invisible text box and setting that as having focus when the second panel appears, but this does not work either.

Any suggestions?

I would link internally to the page. So if you're onhttp://www.someurl.com/somepage.aspx after the Ajax, link internally tohttp://www.someurl.com/somepage.aspx# which will jump to the top of the page.

Alternatively you can do a setFocus call to the <body> tag or some other element that is at the top of the page.

Regards,

Tim

0 件のコメント:

コメントを投稿