کد متن تایپ شونده

به ادامه مطلب بروید

برای استفاده از این کد، کد زیر رو در هر جای قالب که خواستید بذارید تا براتون نمایش بده:
<p style="text-align:right;direction:rtl;" id="scroller"></p>
<script type="text/javascript">
function scroll(position) {
var msg = "متن دلخواه شما";
var out = "";
var sc = document.getElementById("scroller");
for (var i=0; i < position; i++){
out += msg.charAt(i);
}
out += msg.charAt(position);
sc.innerHTML = out;
position++;
if (position != msg.length) {
window.setTimeout(function() { scroll(position); }, 50);
}
else {
window.setTimeout(function() { scroll(0); }, 2000);
}
}
scroll(0);
</script>
افزودن به علاقهمندیها
حذف از علاقهمندی
- 10 مرداد 1394
- 1 دیدگاه
- 7151 بازدید