
November 5th, 2012, 12:23 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 2
Time spent in forums: 50 m 28 sec
Reputation Power: 0
|
|
|
Please help with this "Auto-changing text" script.
I found this script, but dont know how to make it stop repeating, please help me, i really need it.
thank you so much!
here is the script:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>
</head>
<body onload="init();">
<div id="timedMsgDiv"></div>
<script type="text/javascript">
function timedMsg() {
currMsg++;
document.getElementById('timedMsgDiv').innerHTML = msgArr[currMsg%msgArr.length];
};
function init() {
currMsg = -1;
msgArr = Array('this is sentence one', 'this is sentence two', 'this is sentence three', 'this is sentence four');
timedMsg();
var t=setInterval("timedMsg()",4000);
};
window.onload = init();
</script>
</body>
</html>
|