• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Bringing the popup front to set two popup windows side by side

Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a requirement to open two popup windows from two different links and show side by side. On clicking first link first popup opens. When I click second link (on parent window), the first popup is going behind the parent window and the second popup is opening. Now the order I can see is second popup(front), parent window (middle) and first popup (behind parent window).

How can I call the first popup front on opening of second popup ? I am using google chrome.

I am using the following code to do this task, not sure where the code is going wrong...

var popup1;
var popup2;
function openPopUpWin(type){


var url="http://"+port+"/login.html?LoginID="+loginId";

var h=850; var w = 800;
x = (w)/2, y = (h)/2;

if (screen) {
y = (screen.availHeight - h) / 2;
x = (screen.availWidth - w) / 2;

popup1 = window.open(url, 'popup1','scrollbars=yes, width='+w+ ',height='+h+',screenX='+x+',screenY='+y+',top='+0+',left='+0);

var url="loginservler!loginaction?loginId="+loginId;
var height =800;var width = 970;

x = (w)/2, y = (h)/2;

if (screen) {
y = (screen.availHeight - h) / 2;
x = (screen.availWidth - w) / 2;
popup2 = window.open(url, 'popup2','scrollbars=yes, width='+w+ ',height='+h+ ',screenX='+x+ ',screenY='+y+ ',top='+0+ ',left=' +$(window).w)/2);

popup1= window.open("",popup1);

Any help appreciated..

Thank you
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic