...

View Full Version : Wierd thingy.



Full moon
06-16-2002, 10:10 AM
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?

redhead
06-16-2002, 02:16 PM
Hello

I have adapted this script (http://www.javascriptkit.com/script/script2/punchline.shtml) from JavaScript Kit, here it is:



<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 :thumbsup:

dky1e
06-17-2002, 04:26 PM
good quotes :)!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum