ShowModalDialog problem with scrolling

  • Thread starter Thread starter Michael G. Schneider
  • Start date Start date
M

Michael G. Schneider

With IE 6 SP1 on Windows XP:

From Javascript I open a dialog with showModalDialog. Depending on the
resulting HTML, the following might happen.

[1] If the content is small, no scrollbar appears. This is fine.

[2] If the content is very long, a vertical and a horizontal scrollbar
appear. There is no need for the horizontal scrollbar, but this is ok, too.
The content is displayed correctly.

But now, suppose you are viewing [2] and then submit a form contained inside
the HTML. The form is posted to the server, HTML returns to the browser, but
now the content is shifted slightly to the right. I have to move the
scrollbar to the left for being able to see the content fully.

This also happens, if the HTML before and after the submit are completely
identical.

Does anybody know why this happens? Can it be avoided?

I do know that I can perform a "window.scroll(0,0)" in the onload event.
This does work, but it results in the content being displayed at the wrong
and then at the right place. This does not look so good.

Michael G. Schneider
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top