
October 26th, 2009, 07:49 AM
|
 |
Contributing User
|
|
Join Date: Oct 2003
Posts: 570
  
Time spent in forums: 6 Days 8 h 6 m 16 sec
Reputation Power: 10
|
|
|
JavaScript - Workaround for modal windows?
Hi, everybody
I tried to use window.showModalDialog in my web application, but I found out that I can't customize it. I mean the attributes seem not to work. For example, if I set dialogWidth and dialogHeight, it keeps the default size.
(I'm using Vista and IE7, is this a known bug?)
Well... as far as I can't use it, I tried this JavaScript function as workaround:
Code:
function makeModal()
{
document.onfocusout = function()
{
window.focus();
}
}
this makes the popup becomes a "fake" modal window. The problem is when I open a second popup from the first one... the focus will stay on the first one, and I can't even click on the second one.
Could you please suggest me how to fix this workaround?
It seems easy but it's blowing my mind.
Thank you ~
|