• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
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){

if(type=='true'){

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);
popup1.focus();

}else{
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);
if(popup1){
popup1.focus();
}
}
}



Any help appreciated..

Thank you
reply
    Bookmark Topic Watch Topic
  • New Topic