Results 1 to 10 of 10

Thread: Useful Javscript

  1. #1
    Senior Member
    Join Date
    Nov 2002
    Posts
    393

    Talking Useful Javscript

    hello everyone

    Falling Snow

    The season is here - and the big day is closing in. It's time to put your website in the mood, too!
    This script is very small - and requires absolutely no images, thus it has a very quick load time. All of the parameters can be changed at the top of the javascript.

    ( got this in mah email )
    \"I have a 386 Pentium.\"

  2. #2
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    I'm sorry what script ??

    here you have one with images http://www.altan.hr/snow/
    this rain , drop can be transfirmed into a snow * flake http://javascript.internet.com/bgeffects/rain.html
    this is just the one you and I were talking about, but then in dutch http://www.javascript.nl/scripts.php...ript&scr_id=60
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

  3. #3
    Senior Member
    Join Date
    Nov 2002
    Posts
    393

    Arrow sorry, file didnt attach

    hello again people

    forgive me for not checking the file that didnt attach
    i didnt get time to see if my fellow friend meant the same script above, but i have this file here so im simply attaching it.

    thanks
    \"I have a 386 Pentium.\"

  4. #4
    thanks invader, that was help

  5. #5
    Senior Member
    Join Date
    Nov 2002
    Posts
    393
    A fireworks javacript.
    \"I have a 386 Pentium.\"

  6. #6
    Do you want a nice script for snow this is greet

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    var no = 50;
    var speed = 1;
    var ns4up = (document.layers) ? 1 : 0;
    var ie4up = (document.all) ? 1 : 0;
    var s, x, y, sn, cs;
    var a, r, cx, cy;
    var i, doc_width = 800, doc_height = 600;
    if (ns4up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
    }
    else
    if (ie4up) {
    doc_width = document.body.clientWidth;
    doc_height = document.body.clientHeight;
    }
    x = new Array();
    y = new Array();
    r = new Array();
    cx = new Array();
    cy = new Array();
    s = 8;
    for (i = 0; i < no; ++ i) {
    initRain();
    if (ns4up) {
    if (i == 0) {
    document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
    document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
    document.write(",</font></layer>");
    }
    else {
    document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
    document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
    document.write(",</font></layer>");
    }
    }
    else
    if (ie4up) {
    if (i == 0) {
    document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
    document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
    document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
    document.write(",</font></div>");
    }
    else {
    document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
    document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
    document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
    document.write(",</font></div>");
    }
    }
    }
    function initRain() {
    a = 6;
    r[i] = 1;
    sn = Math.sin(a);
    cs = Math.cos(a);
    cx[i] = Math.random() * doc_width + 1;
    cy[i] = Math.random() * doc_height + 1;
    x[i] = r[i] * sn + cx[i];
    y[i] = cy[i];
    }
    function makeRain() {
    r[i] = 1;
    cx[i] = Math.random() * doc_width + 1;
    cy[i] = 1;
    x[i] = r[i] * sn + cx[i];
    y[i] = r[i] * cs + cy[i];
    }
    function updateRain() {
    r[i] += s;
    x[i] = r[i] * sn + cx[i];
    y[i] = r[i] * cs + cy[i];
    }
    function raindropNS() {
    for (i = 0; i < no; ++ i) {
    updateRain();
    if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
    makeRain();
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
    }
    document.layers["dot"+i].top = y[i];
    document.layers["dot"+i].left = x[i];
    }
    setTimeout("raindropNS()", speed);
    }
    function raindropIE() {
    for (i = 0; i < no; ++ i) {
    updateRain();
    if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
    makeRain();
    doc_width = document.body.clientWidth;
    doc_height = document.body.clientHeight;
    }
    document.all["dot"+i].style.pixelTop = y[i];
    document.all["dot"+i].style.pixelLeft = x[i];
    }
    setTimeout("raindropIE()", speed);
    }
    if (ns4up) {
    raindropNS();
    }
    else
    if (ie4up) {
    raindropIE();
    }
    // End -->
    </script>

    More to come http://www.hackerswarrior.fr.st opening February

  7. #7
    Old-Fogey:Addicts founder Terr's Avatar
    Join Date
    Aug 2001
    Location
    Seattle, WA
    Posts
    2,007
    Originally posted here by HackersWarrioR
    Do you want a nice script for snow this is greet
    If you want to contribute, don't do it by copy-pasting and leaving it impled as if it was your own.

    And if you looked you would have noticed that that code is for RAIN, not SNOW... Tsk tsk tsk.
    [HvC]Terr: L33T Technical Proficiency

  8. #8
    Senior Member
    Join Date
    Nov 2002
    Posts
    393
    The script that changes images everyday , depending upon the day .
    It is useful in places, where you need to greet people according to their own timezones :


    <script language="javascript1.1"> today = new Date(); day = today.getDay(); arday = new Array("Sunday.jpg", "Monday.jpg", "Tuesday.jpg", "Wednesday.jpg", "Thursday.jpg", "Friday.jpg", "Saturday.jpg"); document.write("[img]" + arday[day] + "[/img]"); </script>


    ( it was a short script, so i thought a separate file wasnt needed )
    \"I have a 386 Pentium.\"

  9. #9
    Senior Member
    Join Date
    Dec 2002
    Posts
    107
    Hey Invader, I tried setting this as a backround for a web page and it's not working. Do you have any ideas or thoughts of why this is not working. It seems that I have tried everything!
    [pong][blur]Victory to Success[/blur][/pong]is only half won through the[pong][blur]Habit of Hard Work...[/blur][/pong]
    -Jagfire19

  10. #10
    Senior Member
    Join Date
    Nov 2002
    Posts
    393
    How can it be not working ? did you place it in the body tag or your HTML ?
    try both ways,in and out the body tag.
    \"I have a 386 Pentium.\"

Posting Permissions

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