Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change the font, size, and color of script.

    I am using FrontPage 2003. How do I change the font, size, and color of the script? Here is the code I have:

    <BODY onload="daysNoAccident()">

    <SCRIPT>
    var date1 = "Feb 14, 2000"
    var mons = new Array("Jan", "Feb", "March", "April", "May", "June", "July", "August", "Sept", "Oct", "Nov", "Dec")
    var now = new Date();
    var mm = now.getMonth();
    mm = mons[mm];
    var dd = now.getDate();
    var yy = now.getYear();
    var date2 = mm + " " + dd +", "+ yy;

    function daysNoAccident() {
    date1 = date1.toString();
    date2 = date2.toString();
    date1 = Date.parse(date1);
    date2 = Date.parse(date2);
    date1 /= 1000; date1 /= 60; // minutes
    date2 /= 1000; date2 /= 60;
    var result = Math.abs(date1 - date2);
    result = result/60; // = hours
    result = result * 8/24; //hours worked per day
    result = result * 5/7; // working days in week
    result = result * 35 // number of employees
    result = parseInt(result);
    document.write ("You have worked " + result + " hours since 14th February 2000 without an accident");
    }
    </SCRIPT>

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Try something like this

    PHP Code:
    <HTML>
    <
    HEAD>
    <
    TITLE>Document Title</TITLE>

    <
    SCRIPT>
    var 
    date1 "Feb 14, 2000"
    var mons = new Array("Jan""Feb""March""April""May""June""July""August""Sept""Oct""Nov""Dec")
    var 
    now = new Date();
    var 
    mm now.getMonth();
    mm mons[mm];
    var 
    dd now.getDate();
    var 
    yy now.getYear();
    var 
    date2 mm " " dd +", "yy;

    function 
    daysNoAccident() {
    date1 date1.toString();
    date2 date2.toString();
    date1 Date.parse(date1);
    date2 Date.parse(date2);
    date1 /= 1000date1 /= 60// minutes
    date2 /= 1000date2 /= 60;
    var 
    result Math.abs(date1 date2);
    result result/60// = hours
    result result 8/24//hours worked per day
    result result 5/7// working days in week
    result result 35 // number of employees
    result parseInt(result);

    document.getElementById("display").innerHTML="You have worked " result " hours since 14th February 2000 without an accident";

    }
    </SCRIPT>

    <STYLE>

    #display{
    color:#00FF00;
    font-size:30px;
    font-family:arial;

    </STYLE>

    </HEAD>
    <BODY onload="daysNoAccident()">

    <DIV id="display"></DIV>

    </BODY>
    </HTML> 
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •