View Full Version : Add color and styles to popup window

12-28-2006, 06:19 PM
Hi folks, I have a web site where I pop a window with an embeded Windows Media Player.
The site uses master pages and content pages, and has several style sheets.

On the master page for the video content that contains the pop-up, I include this code in the head:

<script language="javascript" type="text/javascript">
function video(url)
a = window.open("#","win1","height=300,width=350")
output = "<center><embed src = \"" + url + "\""
output += "autostart=true"
output += "></center>"

Then, I link from the content page like this:

<a href="#" onclick="video ('../BookContents/MediaContent/ProductionKerriganReading.wmv')">Windows Media Player</a>

This works well, but what I want to do is add some kind of background color, or an image, or text to the new window while the video player is embeded.

Since the "pop" code is on the master page, and the link is elsewhere, I can't seem to find the right place to handle the new window in code with out getting errors about having more than one head or title element. (I tried some inline html, but didn't work.)

Any suggestions would be much appreciated!

12-29-2006, 08:16 PM
Have you tried putting the <embed> inside a <div> and giving the <div> some styles...

output = "<div style=\"height=300px; width=350px; background-color: black;\"><center><embed src = \"" + url + "\""
output += "autostart=true"
output += "></center></div>"