Moving text status

Written by @kerixa 21 August 2012

Have you ever seen a moving status bar?

Code Snippet:

                                                
                                                <!-- this script is provided by www.javascriptfreecode.com coded by: Kerixa Inc. -->
<BODY onLoad="timerONE=window.setTimeout('slide(120,0)',20);">

<SCRIPT LANGUAGE="JavaScript">

function slide(jumpSpaces,position) {
  var msg = "This JavaScript will slide in your desired message....Cool...isn't it???.......drink more coffee"
  var out = ""
  if (endScroll) {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 = "slide(" + jumpSpaces + "," + position + ")";
    scrollID = window.setTimeout(cmd,5);
  } else {
    scrolling = false
    return false 
  }
  return true
}
function ccSetup() {
 if (scrolling) 
  if (!confirm('Re-initialize slide?'))
   return false 
   endScroll = true 
   scrolling = true 
   var killID = window.setTimeout('endScroll=false',6)
   scrollID = window.setTimeout('slide(100,0)',10)
   return true 
}
var scrollID = Object
var scrolling = false
var endScroll = false
</SCRIPT><a target='_blank' href='www.javascriptfreecode.com' style='font-size: 8pt; text-decoration: none'>JavaScript Best Codes</a>                                                
                                            

Example:


About @kerixa

I am Krishna Eydat. I studied Software Engineering at University of Waterloo in Canada. I lead a few tech companies. I am passionate about the way we are connected. I would like to be part of something big or be the big deal!

K

Comments


Here you can leave us commments. Let us know what you think about this code tutorial!

0 / 300

TRENDING POST
1
2
3
4
5
VISITORS
Online Users: 12
Recent Members: Shahmeer, coolcoco7, SmitaPatil25, owoboycute, 092010
advertisement 2