Author Topic: Random Quotation Script  (Read 17015 times)

Tayab

  • Full Member
  • ***
  • Posts: 149
Random Quotation Script
« on: November 01, 2012, 02:29:17 AM »
Hello folks. I've just created/learned the random quotation appearing script with JavaScript Programming. You guys can use if you want.

There is the code.

Code: [Select]
<html xmlns=http:www.w3.org_1999_xhtml xml:lang=en>
<head>
<meta http-equiv=""X-UA-Compitable" content="IE=edge" />
<title>Random Quotes - Tayab</title>
</head>

<style type="text/css">
/*Lets style the javascript in order to make it look nicer and alluring.*/
 dl {
    background-color:orange; /*Makes the background of the quotation orange.*/
text-align:center; /*Makes the alignment of text to center.*/
    opacity:0.6; /*Opacitize the box to 0.6.*/
width:500px; /*Sizing the width of the box.*/
border:2px solid; /* Adding border.*/
    border-radius:25px; /*The rounding of border*/
    -moz-border-radius:25px; /* Making the border work on Mozilla Firefox. */
-webkit-border-radius:25px; /* Making the border work on Safari, Chrome and etc. */
box-shadow: 10px 10px 5px #888888; /*Adding Shadow to border.*/

 }
</style>
<body>
<script type="text/javascript">

 //                                 TTTTTTTTTTT   AAAAA     YYY  YYY  AAAAA   BBBB
 //                                      TT       A   A      YY YY    A   A   B   BB
 //                                      TT       AAAAA       YYY     AAAAA   BBBBB
 //                                      TT       A   A       YY      A   A   B   BB
 //                                      TT   A   A   YY   A   A   BBBBB
 
//                                       I've created this script from scratch by me, I've recently learned JavaScript and will be comming through some other terrific scripts soon.
//                                  If you have any questions or concerns just inbox me at http://ifandbut.com/talk/index.php?action=profile;u=309.
//Storing the quotations into arrays.
quotes = []; //Defining Quotes Array.
authors = []; //Defining Author Array.
quotes[0] = "People started knowing my secrets, to prevent that happen I started learn Algebra."; //Writing Quotes and the arrangement.
authors[0] = "M.Tayab"; //Writing Author.
quotes[1] = "Reality is the leading cause of stress for those in touch with it.";
authors[1] = "Jack Wagner";
quotes[2] = "A lot of people are afraid of heights. Not me, I'm afraid of widths.";
authors[2] = "M.Tayab";

//Asking the index to randomize.
index = Math.floor(Math.random() * quotes.length);

//display the quotation into the page.
document.write("<DL>\n");
document.write("<DT>" + "\"" + quotes[index] + "\"\n");
document.write("<DD>" + "-- " + authors[index] + "\n");
document.write("</DL>\n");

//End the script
</script>
Script created by M.Tayab Soomro.
</body>
</html>

I could have shown you display but don't have any domain atm.

The CSS radius doesn't work on IE, I don't have any solution of it.

 

X

Do you know?

By participating in our community you can get free top level domain as well learn about Search Engine Optimization, Server management and more..
Join Now!
anything