Results 1 to 4 of 4

Thread: Help w/ customizing earthquake code...

  1. #1
    Join Date
    Sep 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help w/ customizing earthquake code...

    I have tried for hours to get the box that you get from the earthquake on page enter code (http://www.dynamicdrive.com/dynamici...earthquake.htm), to vanish. Can anyone help me remove it?

  2. #2
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Quite simple, really

    Hours, eh?

    Remove these two lines:
    Code:
    // show quake message
    quakealert()
    For future reference, // MESSAGE lines are information. Here it states that the next line shows the message box. So remove those lines to deactivate it. You can also remove the <style> in the body, I guess.

    Rgds
    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  3. #3
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah to heck with it. Here's an example HTML with all the code.

    Code:
    <html>
    
    <head>
    <meta name="GENERATOR" content="Microsoft FrontPage 9.5 Beta">
    </head>
    
    <body>
    <script>
    
    /*
    EarthQuake script- © Dynamic Drive (www.dynamicdrive.com)
    For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use, 
    Visit http://dynamicdrive.com
    */
    
    //configure the likelihood that an earthquake will occur (100% means always)
    var chance_of_occurence="50%"
    
    /////do NOT edit below this line/////////////
    
    //variable used to store the equivalency of the 10 rector scales (in the form of 1, 3, 6...etc)
    var rectorscale=new Array(1,3,6,9,12,15,18,21,24,27)
    chance_of_occurence=parseInt(chance_of_occurence)
    
    function earthquake(){
    //randomly assign a number from 1 to 10 to variable rectorindex
    rectorindex=Math.floor(Math.random()*10)
    //randomly assign one of element rectorscale into variable rector
    rector=rectorscale[rectorindex]
    if ((document.all||document.layers)&&Math.floor(Math.random()*100)<=chance_of_occurence) {
    //shake the browser's screen according to the random rector scale!
    for (i=0;i,i<20;i++){
    window.moveBy(0,rector)
    window.moveBy(rector,0)
    window.moveBy(0,-rector)
    window.moveBy(-rector,0)
    }
    
    }
    }
    
    if (document.all)
    document.write('<div id="quakenotice_ie"></div>')
    
    </script>
    <body onLoad="earthquake()"> 
    </body>
    
    </html>
    Regards
    cr3ative
    Last edited by cr3ative; 09-19-2004 at 05:51 PM.
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  4. #4
    Join Date
    Sep 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i could have figured it out...
    The reason i didnt just take that out was i was stupid and thought that the rest of the stuff with the box css and stuff would give me an ugly error message.
    Yes, im stupid.
    ah well.
    Thanks!

Bookmarks

Posting Permissions

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