[thelist] Javascript window question

Anthony Baratta Anthony at Baratta.com
Fri Aug 31 14:02:16 CDT 2001


At 11:44 AM 8/31/2001, you wrote:

>Is there a cross browser compatible way opening a modal window?

"Modal-ness" is an IE only trait. If you want to pop a new window and bring 
it forward here is one way to do that:

<a 
href="javascript:popWindow('./popup.html','_winName','230','180','scrollbars=no,resize=no');">Click 
Here for PopUp Window</a>

function popWindow(theURL,winName,winWidth,winHeight,otherFeatures) {
   var x = 0;
   var y = 0;
   x = (screen.availWidth - 12 - winWidth) / 2;
   y = (screen.availHeight - 48 - winHeight) / 2;
   if (otherFeatures != "") {otherFeatures = "," + otherFeatures}
   var features = "screenX=" + x + ",screenY=" + y + ",width=" + winWidth + 
",height=" + winHeight+",top="+y+",left="+x+"'" + otherFeatures
   var NewWindow = window.open(theURL,winName,features);
   NewWindow.focus();
}
---
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."





More information about the thelist mailing list