Hey, I see in almost news websites bar called quick news and its appear and reading character by character like this site http://www.filgoal.com/English/DefaultDynamic.aspx in the latest news section under menus. i hope if any one can help me to know how it works or give me a sample for that. thanks,
+3
A:
There is a good jQuery plugin that does exactly this. You can read the documentation and download it from
http://plugins.jquery.com/project/BBCnewsTicker
There is an example of it in action on this page
Gavin Draper
2010-08-03 12:52:56
thanks for ur help
Amr Elnashar
2010-08-03 13:13:46
A:
Well, something like this would do if you don't want to use any plugins:
<html>
<head>
<script>
function printTextDelayed(item, text, symbolNum) {
if (symbolNum == undefined) symbolNum = 0;
if (symbolNum < text.length-1) {
item.innerHTML = text.substring(0,symbolNum+1)+"_";
setTimeout(function() {
printTextDelayed(item, text, symbolNum+1);
}, 100+Math.random()*300);
} else {
item.innerHTML = text;
}
}
function printButtonClick() {
printTextDelayed(document.getElementById("dynalink"), document.getElementById("dynatext").value);
}
</script>
</head>
<body>
<input type="text" id="dynatext">
<input type="button" value="Print" onclick="printButtonClick();"/>
<br/>
<a href="#somelink" id="dynalink"></a>
</body>
</html>
Max
2010-08-03 13:06:55