Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  10] [ 7]  / answers: 1 / hits: 23292  / 11 Years ago, tue, september 24, 2013, 12:00:00

I have a Div data which is coming dynamically.
I want to open that div data in popup after some event fired.
I am done with my code. But when popup is opening in my browser its not centered aligned.. Its coming in corner..



My code :-



        var w  = 620;
var h = 360;
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var divText = document.getElementById(inviteConfirmationMessage).outerHTML;
var myWindow = window.open('','','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
var doc = myWindow.document;
doc.open();
doc.write(divText);
doc.close();


Working in Mozilla firefox but not working in Chrome --



http://jsfiddle.net/Wj3Qk/2/



Please help me out !! or any guidance.


More From » jquery

 Answers
12
    var left = (window.screen.width / 2) - ((w / 2) + 10);
var top = (window.screen.height / 2) - ((h / 2) + 50);

window.open('','',
status=no,height= + height + ,width= + width + ,resizable=yes,left=
+ left + ,top= + top + ,screenX= + left + ,screenY=
+ top + ,toolbar=no,menubar=no,scrollbars=no,location=no,directories=no);

[#75476] Monday, September 23, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kerryoliviaa

Total Points: 221
Total Questions: 102
Total Answers: 117

Location: Sint Maarten
Member since Tue, Mar 29, 2022
2 Years ago
;