...

View Full Version : Add color and styles to popup window



gary7
12-28-2006, 05: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")
a.document.open()
output = "<center><embed src = \"" + url + "\""
output += "autostart=true"
output += "></center>"
a.document.write(output)
a.document.close()
}
</script>

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!

Pyth007
12-29-2006, 07: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>"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum