I have the code below to open a pop-up window which works fine. The pop-up has a black background controlled within the body tag of the code in the pop-up itself.
When the pop-up initially opens, the page has a white background then goes black once the code loads. This doesn’t bother me but it does bother my client!
So, is there a way that I can pass the bgcolor color attribute to the pop-up from the javascript that is on the parent page, so that the pop-up is immediately black when it opens. I hope that makes sense!
Here is my current code:
// START OF POP UP ///////////////////////////////////////////////////
function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
// END OF POP UP ///////////////////////////////////////////////////
<a href="javascript:void(0);" onClick="PopupCenter('page.asp', 'myPop1',678,550);" class="staffBioLinks">Click Here</a>
Yes. By using something like this:
You open a blank page, then you set the background color first then redirect to the URL you want to load. During the loading time, the page is black (in my example).