tags:

views:

28

answers:

3

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

http://www.makemineatriple.com/jquery?newsTicker=

Gavin Draper
thanks for ur help
Amr Elnashar
A: 

The BBC style news ticker plugin for jQuery will do what you want.

Pat
Gavin beat me to it.
Pat
thanks for ur help
Amr Elnashar
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
Thanks but i think the jquery one is more simple.
Amr Elnashar