I have added this simple script to a scriptbox and it works great! Does anyone know how to make this script rotate?
<SCRIPT>
/*
Script obtained from Wsabstract.com
For this script and more
Visit Java-Scripts.net or Wsabstract.com
*/
quote0= "Wipe Up and avoid a Slip Up!.";
quote1= "We need you! Work safely. ";
quote2= "Working without Safety is a Dead-End Job. ";
var ran_unrounded=Math.random()*2;
var ran_number=Math.round(ran_unrounded);
document.write(eval("quote"+ran_number));
</SCRIPT>
If you use the random quote snippets you have the same thing, just change the textstrings in that snippet to your own slogan strings and away you go :D
...in my php "random quotes' I now have around 700 diff./ quotes. :)
I cant get random quote snippets to work for me
Try this one in a php block:
$quotes = array (
"Wipe Up and avoid a Slip Up!",
"We need you! Work safely.",
"Working without Safety is a Dead-End Job."
);
shuffle($quotes);
echo $quotes[0];
Add more quotes to the array as you wish.
Thanks JPDeni,
is there any way we can get this to scroll?
u could try moving from side to side...creates a scrolling effect lol
JJ
Quote from: Sharr76 on February 20, 2007, 03:00:52 PM
Thanks JPDeni,
is there any way we can get this to scroll?
Scroll? Like
This is scrolling
Just add a
marquee tag
So instead of
echo $quotes[0];
use
echo '<marquee>' , $quotes[0] , '</marquee>';
You can look up the various options that are available with the tag. And you can format your quote however you want, using a similar structure to the above.
If you mean something different by "scrolling," you'll need to explain a little more. :)
No this is just fine...but it scrolls the same slogan until the page is refreshed. Can we get it to scroll all slogans one after the other....? whithout having to refresh the page?
http://www.ndex.org/index.php (http://www.ndex.org/index.php)
QuoteCan we get it to scroll all slogans one after the other....? whithout having to refresh the page?
We? ;) Yeah, I think I can do that. You'll have to work with it to see the best spacing between them and change the number in line 2.
$space = '&nb' . 'sp;';
$spaces = str_repeat($space,20); // change the number to change the number of spaces between the slogans
$quotes = array (
"Wipe Up and avoid a Slip Up!",
"We need you! Work safely.",
"Working without Safety is a Dead-End Job."
);
shuffle($quotes);
$string = implode($spaces,$quotes);
echo '<marquee>' , $string , '</marquee>';
:coolsmiley: Thanks alot, this is excellent....... ;) how can you slow it down a little..... :)
There's lots of information about how to adjust the marquee tag here (http://www.quackit.com/html/codes/html_marquee_code.cfm). It shows a lot of different options that you can play with. :)