Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

java script Q

Options
  • 28-09-2006 6:36pm
    #1
    Registered Users Posts: 4,285 ✭✭✭


    k im trying to make this lil thing on my music site where u click the link and it opens the song ina new lil window

    i found this code which works grand but i need to change the colors and font colors

    id like the backround black and the text white/links grey

    i just made the backround black (000000) behind the embeded player and window but the download link is Blue id like it grey (808080) and the text beside it white (FFFFFF)

    heres the code, i hope it shows up nice =/ hope anyone can help



    // JavaScript Document
    // Pop-Up Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com
    var UniqueID = 314 // Make each link open in a new window.
    var newWinOffset = 0 // Position of first pop-up
    function PlayerOpen(soundfiledesc,soundfilepath) {

    PlayWin = window.open('',UniqueID,'width=320,height=190,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
    PlayWin.focus();
    var winContent = "<HTML><HEAD><TITLE>" + soundfiledesc + "</TITLE></HEAD><BODY bgcolor='#000000'>";
    winContent += "<B style='font-size:18px;font-family:Verdana,sans-serif;line-height:1.5'>" + soundfiledesc + "</B>";


    winContent += "<OBJECT width='300' height='42'>";
    winContent += "<param name='SRC' value='" + soundfilepath + "'>";
    winContent += "<param name='AUTOPLAY' VALUE='true'>";
    winContent += "<param name='CONTROLLER' VALUE='true'>";
    winContent += "<param name='BGCOLOR' VALUE='#000000'>";
    winContent += "<EMBED SRC='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#808080'></EMBED>";
    winContent += "</OBJECT>";

    winContent += "<p style='font-size:12px;font-family:Verdana,sans-serif;text-align:center'><a href='"+soundfilepath+"'>Download this file</a> <SPAN style='font-size:10px'>(right-click - save target as)</SPAN></p>";

    winContent += "<FORM><DIV align='center'><INPUT type='button' value='Close this window' onClick='javascript:window.close();'></DIV></FORM>";
    winContent += "</BODY></HTML>";
    PlayWin.document.write(winContent);
    PlayWin.document.close(); // "Finalizes" new window
    UniqueID = UniqueID + 1
    // newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower.
    }


    i see where i have to edit the code but not sure how with java..

    + wasnt sure where to post this


Comments

  • Closed Accounts Posts: 583 ✭✭✭monkey tennis


    Edit the CSS info:

    Change <SPAN style='font-size:10px'>(right-click - save target as)</SPAN>

    to <SPAN style='font-size:10px; color:white'>(right-click - save target as)</SPAN>

    and <a href='"

    to <a style="color: #808080" href='"

    Then go to www.w3schools.com/css to see what's at work.


  • Registered Users Posts: 4,285 ✭✭✭-=al=-


    Thanks ill try it now and see if it works, its probly a complete newbie Q!

    Im doing super on the guesswork on the html, nevermind the java guesswork on my site, kinda learning as i go, tis quite simple yet complicated!

    ill give it a whirl


  • Registered Users Posts: 4,285 ✭✭✭-=al=-


    Edit the CSS info:

    Change <SPAN style='font-size:10px'>(right-click - save target as)</SPAN>

    to <SPAN style='font-size:10px; color:white'>(right-click - save target as)</SPAN>

    and <a href='"

    to <a style="color: #808080" href='"


    Then go to www.w3schools.com/css to see what's at work.


    that bit didnt work =/

    and what about the heading colour?


  • Registered Users Posts: 4,285 ✭✭✭-=al=-


    well seemed to have gotten it the way i liked - heres what worked in the end if ya wanted to know

    // JavaScript Document
    // Pop-Up Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com
    var UniqueID = 314 // Make each link open in a new window.
    var newWinOffset = 0 // Position of first pop-up
    function PlayerOpen(soundfiledesc,soundfilepath) {

    PlayWin = window.open('',UniqueID,'width=320,height=190,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
    PlayWin.focus();
    var winContent = "<HTML><HEAD><TITLE>Alan McKenna Mp3 player</TITLE></HEAD><BODY bgcolor='#000000'>";
    winContent += "<B style='font-size:16px;font-family:Verdana,sans-serif; line-height:1.5;color:#FFFFFF;'>" + soundfiledesc + "</B>";

    winContent += "<OBJECT width='300' height='42'>";
    winContent += "<param name='SRC' value='" + soundfilepath + "'>";
    winContent += "<param name='AUTOPLAY' VALUE='true'>";
    winContent += "<param name='CONTROLLER' VALUE='true'>";
    winContent += "<param name='BGCOLOR' VALUE='#000000'>";
    winContent += "<EMBED SRC='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#000000'></EMBED>";
    winContent += "</OBJECT>";

    winContent += "<p style='font-size:12px; color:black; font-family:Verdana,sans-serif;text-align:center;color:#808080;'><a href='"+soundfilepath+"'><style='color:#808080;'Download this file</a></style> <SPAN style='font-size:10px;font-decoration:none;text-underline:none;text-decoration:None; color:#808080'><U>To Download: (right-click this link - save as)</U></SPAN></p>";

    winContent += "<FORM><DIV align='center'><INPUT type='button' value='Close This Window' onClick='javascript:window.close();'></DIV></FORM>";
    winContent += "</BODY></HTML>";
    PlayWin.document.write(winContent);
    PlayWin.document.close(); // "Finalizes" new window
    UniqueID = UniqueID + 1
    // newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower.
    }


    :)


Advertisement