Kahuki Webmaster Forum  

Go Back   Kahuki Webmaster Forum > Website Development & Management > Programming > JavaScript

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-23-2007, 10:31 AM
Rookie
 
Join Date: Dec 2007
Posts: 43
jgrant is on a distinguished road
I just found this while browsing: Letter by letter scroll

HTML Code:
<SCRIPT LANGUAGE="JavaScript">
function scroll(jumpSpaces,position) {
var msg = "There is Hope - Computer Hope"
var out = ""
if (killScroll) {return false}
for (var i=0; i<position; i++){
out += msg.charAt(i)}
for (i=1;i<jumpSpaces;i++) {
out += " "}
out += msg.charAt(position)
window.status = out
if (jumpSpaces <= 1) {
position++
if (msg.charAt(position) == ' ') {
position++ }
jumpSpaces = 100-position
}
else if (jumpSpaces > 3) {
jumpSpaces *= .75}
else {
jumpSpaces--}
if (position != msg.length) {
var cmd = "scroll(" + jumpSpaces + "," + position + ")";
scrollID = window.setTimeout(cmd,5);
}
else {
scrolling = false
return false}
return true;
}
function startScroller() {
if (scrolling)
if (!confirm('Re-initialize snapIn?'))
return false
killScroll = true
scrolling = true
var killID = window.setTimeout('killScroll=false',6)
scrollID = window.setTimeout('scroll(100,0)',10)
return true
}
var scrollID = Object
var scrolling = false
var killScroll = false
// End -->
</SCRIPT>
</HEAD>

<BODY onLoad="startScroller()"> 
What this does is make it so, letter by letter, scrolls the phrase, "There is Hope - Computer Hope."
I found this script at http://www.computerhope.com/cooltrik.htm, and just thought I should share!~

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:22 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0