Le book de Batportugais  http://Batportugais.soonnight.net    Powered by SoonNight.com

Accueil













TypingText = function(element, interval, cursor, finishedCallback) {

if((typeof document.getElementById == "undefined") || (typeof element.innerHTML == "undefined")) {

this.running = true; // Never run.

return;

}

this.element = element;

this.finishedCallback = (finishedCallback ? finishedCallback : function() { return; });

this.interval = (typeof interval == "undefined" ? 50 : interval);

this.origText = this.element.innerHTML;

this.unparsedOrigText = this.origText;

this.cursor = (cursor ? cursor : "");

this.currentText = "";

this.currentChar = 0;

this.element.typingText = this;

if(this.element.id == "") this.element.id = "typingtext" + TypingText.currentIndex++;

TypingText.all.push(this);

this.running = false;

this.inTag = false;

this.tagBuffer = "";

this.inHTMLEntity = false;

this.HTMLEntityBuffer = "";

}

TypingText.all = new Array();

TypingText.currentIndex = 0;

TypingText.runAll = function() {

for(var i = 0; i < TypingText.all.length; i++) TypingText.all[i].run();

}

TypingText.prototype.run = function() {

if(this.running) return;

if(typeof this.origText == "undefined") {

setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval); // We haven't finished loading yet. Have patience.

return;

}

if(this.currentText == "") this.element.innerHTML = "";

// this.origText = this.origText.replace(/

Partager

Reportages photos