Changing the bgcolor of a Javascript window?

Discussion in 'Software' started by Morgan19, Aug 17, 2005.

  1. Morgan19

    Morgan19 Specialist

    I'd like to change the color of a Javascript window that pops up when you click on a link, but for the life of me can't figure out how to code it. This is what I've got in the head:

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=820,height=350, left = 240,top = 358');");
    }
    // End -->
    </script>

    I want the background of that window to be #FFFFCC, so what would I need to add to have it display that color when the window comes up?

    m19
     
  2. goldfish

    goldfish Lt. Sushi.DC

    Use this property
    Code:
    window.document.body.style.backgroundColor = "#3355CC";
    
    where window is the name of the popup you just made, in your case being "page" + id. You'll probably want to eval that too. So somthing like
    Code:
    eval("page" + id + ".document.body.backgroundColor = \"#3355cc\")
    
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds