nNemethon
05-30-2004, 05:40 AM
Hello and welcome once again to my "Oooh my grey cells hurt" page. ;)
Upon discovering the <DIV> command, I became over the moon with the absolute; function. Wonderful way to chuck anything pretty much anywhere. Though, now I begat a problem...
I have implemented a (yawn) random-quote thingy in one of my page-frames. It all works rather well and I am impressed at the simplicity of it. But here is where the dilemma starts... I am trying to center the quote on the screen (accomplished), but I am also attempting to blur it slightly by using <div> commands to offset the same quote 1 pixel to the left and one pixel to the right of the orig quote (Using diff colours of course). I can do this easily by using absolute;, only I am unable now, with the centering code, to align all three quotes on the same pixel height.
In short: I am after a little help to get all three quotes on the same pixel height (non-centered), horizontally centered, and 2 offset by a pixel each way of original.
My page code is as follows:
<HTML>
<HEAD>
<META NAME="Author" CONTENT="nNemethon">
<style>
#quot {text-align: center;}
#quotl {text-align: center;}
#quotr {text-align: center;}
</style>
</HEAD>
<script language="JavaScript">
<!-- Hide from old browsers
// Copyright © 1999 Doug Popeney
// Created by Doug Popeney (easyjava@easyjavascipt.com)
// JavaScript Made Easy!! - http://www.easyjavascript.com
var a = Math.random() + ""
var rand1 = a.charAt(5)
quotes = new Array
quotes[1] = "MESSAGE #1"
quotes[2] = "MESSAGE #2"
quotes[3] = "MESSAGE #3"
quotes[4] = "MESSAGE #4"
quotes[5] = "MESSAGE #5"
quotes[6] = "MESSAGE #6"
quotes[7] = "MESSAGE #7"
quotes[8] = "MESSAGE #8"
quotes[9] = "MESSAGE #9"
quotes[0] = "MESSAGE #10"
var quote = quotes[rand1]
// -- End Hiding Here -->
</script>
<BODY BGCOLOR=black BACKGROUND="bottom.jpg" NOSAVE>
<font color="white">
<div id="quot">
<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write("<b>" + quote + "</b>")
// -- End Hiding Here -->
</script>
</DIV>
<div id="quotl">
<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write("<b><font color=lime>" + quote + "</b>")
// -- End Hiding Here -->
</script>
</DIV>
<div id="quotr">
<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write("<b><font color=red>" + quote + "</b>")
// -- End Hiding Here -->
</script>
</DIV>
</BODY>
</HTML>
The colours do not matter at the moment, they are just for testing purposes.
Another (hopefully easy) query, is how do I get the random quotes to go above 10? I would like to be able to go unlimited, tho I dont have that many quotes. =D
(Insert quote from Einstein's Relativity and of Improbability in the Infinity) ;)
Thank-you if you are able to help on this one. I have toyed away approx 8 hours now on changing variables, tags, code and trauling msg forums all over, and my head really hurts a lot now. ;)
nNemethon
Upon discovering the <DIV> command, I became over the moon with the absolute; function. Wonderful way to chuck anything pretty much anywhere. Though, now I begat a problem...
I have implemented a (yawn) random-quote thingy in one of my page-frames. It all works rather well and I am impressed at the simplicity of it. But here is where the dilemma starts... I am trying to center the quote on the screen (accomplished), but I am also attempting to blur it slightly by using <div> commands to offset the same quote 1 pixel to the left and one pixel to the right of the orig quote (Using diff colours of course). I can do this easily by using absolute;, only I am unable now, with the centering code, to align all three quotes on the same pixel height.
In short: I am after a little help to get all three quotes on the same pixel height (non-centered), horizontally centered, and 2 offset by a pixel each way of original.
My page code is as follows:
<HTML>
<HEAD>
<META NAME="Author" CONTENT="nNemethon">
<style>
#quot {text-align: center;}
#quotl {text-align: center;}
#quotr {text-align: center;}
</style>
</HEAD>
<script language="JavaScript">
<!-- Hide from old browsers
// Copyright © 1999 Doug Popeney
// Created by Doug Popeney (easyjava@easyjavascipt.com)
// JavaScript Made Easy!! - http://www.easyjavascript.com
var a = Math.random() + ""
var rand1 = a.charAt(5)
quotes = new Array
quotes[1] = "MESSAGE #1"
quotes[2] = "MESSAGE #2"
quotes[3] = "MESSAGE #3"
quotes[4] = "MESSAGE #4"
quotes[5] = "MESSAGE #5"
quotes[6] = "MESSAGE #6"
quotes[7] = "MESSAGE #7"
quotes[8] = "MESSAGE #8"
quotes[9] = "MESSAGE #9"
quotes[0] = "MESSAGE #10"
var quote = quotes[rand1]
// -- End Hiding Here -->
</script>
<BODY BGCOLOR=black BACKGROUND="bottom.jpg" NOSAVE>
<font color="white">
<div id="quot">
<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write("<b>" + quote + "</b>")
// -- End Hiding Here -->
</script>
</DIV>
<div id="quotl">
<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write("<b><font color=lime>" + quote + "</b>")
// -- End Hiding Here -->
</script>
</DIV>
<div id="quotr">
<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write("<b><font color=red>" + quote + "</b>")
// -- End Hiding Here -->
</script>
</DIV>
</BODY>
</HTML>
The colours do not matter at the moment, they are just for testing purposes.
Another (hopefully easy) query, is how do I get the random quotes to go above 10? I would like to be able to go unlimited, tho I dont have that many quotes. =D
(Insert quote from Einstein's Relativity and of Improbability in the Infinity) ;)
Thank-you if you are able to help on this one. I have toyed away approx 8 hours now on changing variables, tags, code and trauling msg forums all over, and my head really hurts a lot now. ;)
nNemethon