| View previous topic :: View next topic |
| Author |
Message |
Viralize New Signing


Joined: 18 Oct 2007 Posts: 11
|
Posted: Thu Oct 18, 2007 7:14 pm Post subject: [CODE] Random Quote Generator onClick |
|
|
Date Made: 15th October, 2007
What it does: You assign quotes. Then, wherever you place the code, there will be a button which, if you click will bring up a pop-up-box with a random quote from what you assigned. Pop-ups will need to be allowed for z3.invisionfree.com .
Copyright: In the code, do not remove.
Preview: http://z3.invisionfree.com/forumclocktest/index.php
Coding (In Code or Quote tags):
Footers
| Quote: |
<!--
Random Quote Generator by Viralize of http://www.ZetaResources.com/
//-->
<script language="JavaScript">
<!--
var nofquo=5
function get_random()
{
var ranNum= Math.floor(Math.random()*nofquo);
return ranNum;
}
function getaQuote()
{
var quoteran=get_random();
var quote=new Array(nofquo)
quote[0]="Quote1";
quote[1]="Quote2";
quote[2]="Quote3";
quote[3]="Quote4";
quote[4]="Quote5";
alert(quote[quoteran]);
}
//-->
</script>
|
Change this number to the amount of quotes you are using.
Change the text in the double quotations to whatever quotes you want. The number in straight brackets after 'Quote' needs to be increased by 1 for each quote, starting at 0.
For another quote, add:
| Quote: |
quote[number]="New Quote Text";
|
With the red text to be edited accordingly.
Paste wherever you want the button to appear:
| Code: |
<body>
<form name="form1">
<input type="button" value="Generate Quote" onClick="getaQuote()">
</form
</body>
|
_________________
 |
|
| Back to top |
|
 |
NoOnAn-2k7 First Team



Joined: 03 Jul 2007 Posts: 1465 Location: Ireland
|
Posted: Thu Oct 18, 2007 7:26 pm Post subject: |
|
|
erm ok thanks!! _________________
"pik a flower nt a fite......throw a party nt a punch....choose a smile nt a missile!!!!" |
|
| Back to top |
|
 |
Viralize New Signing


Joined: 18 Oct 2007 Posts: 11
|
Posted: Thu Oct 18, 2007 7:28 pm Post subject: |
|
|
Lol. It isn't much, but it was made as a request, so Ifelt like posting it here for people to use freely, as long as the copyright is intact. _________________
 |
|
| Back to top |
|
 |
NoOnAn-2k7 First Team



Joined: 03 Jul 2007 Posts: 1465 Location: Ireland
|
Posted: Thu Oct 18, 2007 7:32 pm Post subject: |
|
|
thats grand thanks a lot ur a new member and already uve done more than some!!! _________________
"pik a flower nt a fite......throw a party nt a punch....choose a smile nt a missile!!!!" |
|
| Back to top |
|
 |
|