Cara membuat tekt bergerak seperti mengetik
<p id="scroller"></p>
<script type="text/javascript">
// Original:
function scroll(position) {
var msg = "silahkan Isi di sini tulisan anda";
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>
Silahkan Copy code di atas dan simpan di code html anda
0 komentar