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 3 of 3

Thread: Wierd thingy.

  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wierd thingy.

    Im not sure if this is possible, but hey...

    I have a picture, right? And when someone clicks on it a RANDOM message appears next to it. Is it possible?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Heres the script

    Hello

    I have adapted this script from JavaScript Kit, here it is:

    Code:
     
    <table>
      <tr>
        <td>
          <div onclick="randomdisplay()" style="cursor: crosshair">
            <img src="IMAGE.jpg" alt="Click to display a random quote">
          </div>
        </td>
    
        <td>
          <form name="scriptform">
           <textarea name="scriptinput" cols="20" rows="5" style="border:0;background-color:#FFFFFF;font-family: verdana; color:#000000; font-size: 12pt;"></textarea>
           </form>
        </td>
      </tr>
    </table>
    <script> 
    
    //Satirical Punch Line Script- by javascriptkit.com (text by Colin Lingle)
    //Visit JavaScript Kit (http://javascriptkit.com) for script
    //Credit must stay intact for use
    
    quotes = new Array();
    quotes[0]="Warning: Dates in Calendar are closer than they appear.";
    quotes[1]="Daddy, why doesn't this magnet pick up this floppy disk?"
    quotes[2]="Give me ambiguity or give me something else."
    quotes[3]="I.R.S.: We've got what it takes to take what you've got!"
    quotes[4]="We are born naked, wet and hungry.  Then things get worse."
    // ADD MORE HERE IF YOU WANT
    
    function randomdisplay(){
    randomquote=quotes[Math.floor(Math.random()*quotes.length)]
    document.scriptform.scriptinput.value=randomquote
    }
    
    setTimeout("randomdisplay()",100)
    
    </script>
    
    <p align="center"><font face="arial" size="-2">This free script provided by</font><br>
    <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
    Kit</a></font></p>
    add as many quotes as you want, and remember to change "IMAGE.jpg" to the url of your image.

    good luck
    redhead

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Location
    CT
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    good quotes !


  •  

    Posting Permissions

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