Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to refactor from using window.open(...) to an unobtrusive modal dhtml window?
    text
    copied!<p>I have a function which launches a javascript window, like this</p> <pre><code> function genericPop(strLink, strName, iWidth, iHeight) { var parameterList = "location=0,directories=0,status=0,menubar=0,resizable=no, scrollbars=no,toolbar=0,maximize=0,width=" + iWidth + ", height=" + iHeight; var new_window=""; new_window = open(strLink, strName, parameterList); window.self.name = "main"; new_window.moveTo(((screen.availWidth/2)-(iWidth/2)),((screen.availHeight/2)-(iHeight/2))); new_window.focus(); } </code></pre> <p>This function is called about 52 times from different places in my web application.</p> <p>I want to re-factor this code to use a DHTML modal pop-up window. The change should be as unobtrusive as possible.</p> <p>To keep this solution at par with the old solution, I think would also need to do the following</p> <ol> <li>Provide a handle to "Close" the window.</li> <li>Ensure the window cannot be moved, and is positioned at the center of the screen.</li> <li>Blur the background as an option.</li> </ol> <p>I thought <a href="http://particletree.com/features/lightbox-gone-wild/" rel="nofollow noreferrer">this solution</a> is the closest to what I want, but I could not understand how to incorporate it.</p> <p>Edit: A couple of you have given me a good lead. Thank you. But let me re-state my problem here. I am re-factoring existing code. I should avoid any change to the present HTML or CSS. Ideally I would like to achieve this effect by keeping the function signature of the genericPop(...) same as well.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload