Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-16-2002, 09:10 AM   PM User | #1
Full moon
New to the CF scene

 
Join Date: Jun 2002
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Full moon is an unknown quantity at this point
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?
Full moon is offline   Reply With Quote
Old 06-16-2002, 01:16 PM   PM User | #2
redhead
Regular Coder

 
Join Date: Jun 2002
Location: United Kingdom Confused: Often
Posts: 859
Thanks: 0
Thanked 0 Times in 0 Posts
redhead is an unknown quantity at this point
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
redhead is offline   Reply With Quote
Old 06-17-2002, 03:26 PM   PM User | #3
dky1e
New to the CF scene

 
Join Date: Jun 2002
Location: CT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
dky1e is an unknown quantity at this point
good quotes !
dky1e is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:51 PM.


Advertisement
Log in to turn off these ads.