#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    2
    Rep 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>
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,173
    Rep Power
    184
    Code:
    clearInterval(t);
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0
    where to put that script, please

IMN logo majestic logo threadwatch logo seochat tools logo