PDA

View Full Version : random text with additional information



piddle
05-12-2014, 05:07 PM
How to combine two scripts?

Random txt:
--------------------------------------

<html>
<body bgcolor="black" text="#CCCCCC" link="#CCCCCC" vlink="#CCCCCC" alink="#CCCCCC">
<table border="1" width="284" align="center">
<tr>
<td width="274" height="68">

<p>

<script language="JavaScript">
<!--
function random_text()
{};
var random_text = new random_text();
// Set the number of text strings to zero to start
var number = 0;
// Incremental list of all possible Text
random_text[number++] = "<font color='#CCCCCC'> Random Txt #1</font>"
random_text[number++] = "<font color='#CCCCCC'> Random Txt #2</font>"
random_text[number++] = "<font color='#CCCCCC'> Random Txt #3</font>"

var random_number = Math.floor(Math.random() * number);
document.write(random_text[random_number]);
-->


</script>
</p>
</td>
</tr>
</table>
<form>
</p>
</form>


---------------------------------------------



additional information:
------------------------------------------
<script language="JavaScript" type="text/javascript">
function showText(ele) {
document.getElementById(ele).style.visibility = "visible";
}
</script>
<body>
<p><a href="javascript:showText('theText');">some information &gt;&gt;</a> <span style="visibility:hidden;" id="theText">some other hidden information</span></p>
</body>
-----------------------------------------------------

new script must give a random txt(1-3) with link,
on click showing additional info(1-3)