This is a JavaScript to scroll a list of messages or texts to save spaces on your web page. It will show a text one after another from a list which can be displayed in a single DIV or INPUT element. It is best to implement this one for news texts and texts ads.
Demo
SCROLLED MESSAGES
Click the button to play the scroller
Source Code
<html>
<head>
<script language="JavaScript">
//List your messages here
var msg = new Array();
msg[0] = "This is message 1";
msg[1] = "This is message 2";
msg[2] = "This is message 3";
//Here's the function to scroll your messages
function play(num){
//Check whether it reach your last message
//to go back to the first message
if(num >= msg.length)
num = 0;
//Variable declarations
var tmp_elm = document.getElementById("div_display");
var tmp = tmp_elm.innerHTML;
var tmp_next;
//Scrolling process
var random = Math.floor(Math.random() * msg[num].length);
var tmp_chr = msg[num].charAt(random);
if(tmp == msg[num]){
num++;
setTimeout("play("+num+")",4000);
return;
}
if(tmp_chr == tmp.charAt(random)){
play(num);
return;
}
//Preparing output
var first_part = tmp.substring(0,random);
random++;
var last_part = tmp.substring(random,msg[num].length);
var tmp_next = first_part + tmp_chr + last_part;
tmp_elm.innerHTML = tmp_next;
//Recall play
setTimeout("play("+num+")",200);
}
</script>
</head>
<body onload="play(0);">
<div id="div_display">SCROLLED MESSAGES</div>
</body>
</html>
xhanch: @sbothailand we need to look at the design preview. The price will be design complexity and required features - posted 1 month ago via Xhanch Studio
sbothailand: @xhanch have question If I design own psd manga site How much you charge for psd to wp? - posted 2 months ago via web