Fourni par Blogger.

dimanche 11 août 2013

Javascript Code: Text dance in status bar 3

Status bar with a typing nice effect. It is like someone is typing the different sentences in the status bar



!-- Start of Typing Text Script -->
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

var speed = 100 
var pause = 1000 
var timerID = null
var texttype = false
var ar = new Array()

ar[0] = "This is the Typing Text Javascript"
ar[1] = "CoffeeCup Software is cool!"
ar[2] = "El HTML Editor++ es muy bueno!"

var msgnow = 0
var offset = 0

function stopBanner() {
        if (texttype)
                clearTimeout(timerID)
        texttype = false
}

function startBanner() {
        stopBanner()
        showBanner()
}

function showBanner() {
        var text = ar[msgnow]

        if (offset < text.length) {
                if (text.charAt(offset) == " ")
                        offset++                        

                var partialMessage = text.substring(0, offset + 1) 
                window.status = partialMessage
                offset++ 
                timerID = setTimeout("showBanner()", speed)
                texttype = true
        } else {
                offset = 0
                msgnow++
                if (msgnow == ar.length)
                        msgnow = 0

                timerID = setTimeout("showBanner()", pause)
                texttype = true
        }
}

</SCRIPT>
</HEAD>
<BODY onLoad="startBanner()">
</BODY>
</HTML>
<!-- END OF SCRIPT -->
<font face="Tahoma"><a target="_blank" href="http://javascriptcodefree.blogspot.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>





Compatible browsers:
IEOpera

0 commentaires:

Enregistrer un commentaire

Make javascriptcodefree.blogspot.com your home page