Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : Custom Widgets > Random Quotes
Mottie (SuperAdmin) 10/5/2008 7:30 PM EST : Random Quotes Box
ACK!
Mottie
Posts: 3884

0
Like

0
Dislike

Random Quotes Box

GuildPortal admin site link to original post

This script just adds a box that displays random text, images or even embeded objects. Just follow the examples and instructions below

The Code

<style type="text/css">
#randomQuote { background: #000000 url(); border: #333333 1px solid; width:200px; text-align:left;}
.hide {display:none;}
</style>
<div id="quotebx" align="center">
<div id="randomQuote"></div>

<!--
******************************
 Add your random quotes below.
 
 <div id="quote#" class="hide">
  QUOTE HERE
 </div>
****************************** -->

<div id="quote1" class="hide">
 "Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy."<br>
 ~Albert Einstein

</div>

<div id="quote2" class="hide">
 "The main reason Santa is so jolly is because he knows where all the bad girls live."<br>
  ~George Carlin

</div>

<div id="quote3" class="hide">
 "I busted a mirror and got seven years bad luck, but my lawyer thinks he can get me five."<br>
 ~Steven Wright

</div>

<div id="quote4" class="hide">
 Homer: Are you saying you're never going to eat any animal again? What about bacon?<br>
 Lisa: No.<br>
 Homer: Ham?<br>
 Lisa: No.<br>
 Homer: Pork chops?<br>
 Lisa: Dad, those all come from the same animal.<br>
 Homer: Heh heh heh. Ooh, yeah, right, Lisa. A wonderful, magical animal.<br>

</div>

<div id="quote5" class="hide">
 <img src="http://i201.photobucket.com/albums/aa236/Mottie1/forums/lecturer.gif" align="right">
 A linguistics professor was lecturing to his English class one day.<br>
 <br>
 "In English," he said, "A double negative forms a positive. In some languages, though, such as Russian, a double negative is still a negative.<br>
 <br>
 However, there is no language wherein a double positive can form a negative."<br>
 <br>
 A voice from the back of the room piped up, "Yeah, right."<br>

</div>

<div id="quote6" class="hide">
 <img src="http://i201.photobucket.com/albums/aa236/Mottie1/forums/05.jpg">
</div>

<script type="text/javascript">
// ********************************
// Don't change anything below this line
// ********************************
var quotes = ($("#quotebx").find("div").length) - 1;
var rnd = "#quote" + Math.floor((Math.random()*(quotes))+1);
$("#randomQuote").html($(rnd).html());
</script>
</div>

Customizing

  • The "#randomQuote" in the CSS defines the style of the quote box.

    • Background color "#000000" & image "url(URL TO IMAGE)" can be modified.

    • Border color "#333333", thickness and style.

    • "width:200px;" can be changed to fit your column width. It's not really necessary, but I added it for testing.

  • Add more quotes by adding the following template:

     <div id="quote#" class="hide">
     QUOTE HERE
     </div>

    • Replace the "#" in "quote#" with the next number in the series.

    • Add your text, images or embedded objects in the "QUOTE HERE" area.

  • Make sure that when you add the script, you are in HTML mode () FIRST!!!
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%