TinyPortal

Development => Block Codes => Topic started by: alan s on August 30, 2006, 03:46:34 PM

Title: Scrolling Title Bar Message
Post by: alan s on August 30, 2006, 03:46:34 PM
Found this nice snippet , adds a scrolling message to the title bar , works in FF , IE and Opera


<script language="JavaScript">
<!--
var space = " ";
var speed = "200";
var pos = 0;
var msg = "Welcome To TheTeenZone.Net";
function Scroll()
{
document.title = msg.substring(pos, msg.length) + space + msg.substring(0,pos);
pos++;
if (pos > msg.length) pos = 0;
window.setTimeout("Scroll()", speed);
}
Scroll();
-->
</script>


To change the scroll speed change the number in the line            var speed = "200";

To change the message change the text in the line                  var msg = "Welcome To TheTeenZone.Net";


Demo - http://theteenzone.net/forum
Title: Re: Scrolling Title Bar Message
Post by: RoarinRow on August 30, 2006, 05:59:33 PM
Ahhh another cool snippet  :up:
Title: Re: Scrolling Title Bar Message
Post by: Jpg on August 30, 2006, 06:03:15 PM
YO THAT'S SWEEEET!!! WHOA!!
Title: Re: Scrolling Title Bar Message
Post by: akulion on August 30, 2006, 07:09:34 PM
dont u know those are illegal  in the state of Texas?
lol jk

thanks - cool find
Title: Re: Scrolling Title Bar Message
Post by: Jpg on August 31, 2006, 01:44:55 AM
How do I add this?
Title: Re: Scrolling Title Bar Message
Post by: akulion on August 31, 2006, 02:29:50 AM
put in scriptbox block

change the text inside

activate

thats all

make sure u dont use frame or title for the block and keep it somewhere not so obivious since the scrolling appears at the top bar and not inside the block..infact the block stays empty
Title: Re: Scrolling Title Bar Message
Post by: alan s on August 31, 2006, 12:43:05 PM
Quote from: Jpg on August 31, 2006, 01:44:55 AM
How do I add this?

Or you could just add the code at the end of a existing html/javascript box since it wont damage the code that already in there and it will work perfectly.Thats what i did
Title: Re: Scrolling Title Bar Message
Post by: Jpg on August 31, 2006, 02:48:18 PM
Ok cool. Thanks.
Title: Re: Scrolling Title Bar Message
Post by: uberjon on August 31, 2006, 06:45:08 PM
i could kiss you. thats just pimpin...

ok now to figure out how to change that lil icon before the http:// in the address bar.

then il have learned enough for today :P lol

ty thats great. maybe u should post it on the smf forums too ;) might be more helpful ;)
Title: Re: Scrolling Title Bar Message
Post by: IchBin on August 31, 2006, 08:47:41 PM
Quote from: uberjon on August 31, 2006, 06:45:08 PM

ok now to figure out how to change that lil icon before the http:// in the address bar.

http://www.tinyportal.net/smf/index.php?topic=2744.0
Title: Re: Scrolling Title Bar Message
Post by: alan s on August 31, 2006, 08:56:57 PM
Glad you like it!

The icon before the http:// is called a favicon , usually a .ico file size 16 X 16 .

so create a normal .bmp image 16 X 16 convert it to a .ico file using something like this

http://www.itlocation.com/en/software/prd65291,,.htm

or use this online converter

http://www.html-kit.com/e/favicon.cgi

and then add this line in beteween the <head> tags on the page you want the favicon to appear , if you want it to appear in the forum add it before the <? tag at the top of the index.template.php file in the theme your using.

<LINK rel="SHORTCUT ICON" href="http://www.yoursitesname.com/favicon.ico" />


Hope i helped!

Title: Re: Scrolling Title Bar Message
Post by: Jpg on August 31, 2006, 09:15:57 PM
Whoa. Thanks again dude. Now I can add a favicon ;)
Title: Re: Scrolling Title Bar Message
Post by: babjusi on May 16, 2007, 12:58:03 AM
Quote from: Alan S on August 31, 2006, 12:43:05 PM
Quote from: Jpg on August 31, 2006, 01:44:55 AM
How do I add this?

Or you could just add the code at the end of a existing html/javascript box since it wont damage the code that already in there and it will work perfectly.Thats what i did

That''s what I did as well.
Thank you Alan S for this code