September 8, 201016 yr hello, i will not waste the time i want to make a script in javascript this script change the hot news shown in an area start news1 after 5 sec news2 after 5 sec news3 and so on.. i want to have break between the news 5 sec when i used this code alert("before waiting"); setTimeout("alert('now')",5000); alert("after waiting"); that was the result 1-before waiting 2-after waiting 3-now (appeared after 5 sec) but i want to be 1-before waiting 2-now (after 5 sec) 3-after waiting and when i used wait() instead of setTimeout() only "before waiting" alert appeard and the "after waiting" alert didn't appeared DO u help me to set timebreak between the news?? ------------- hosam alaa www.sa7afa.net
September 9, 201016 yr Ohh. you want the script to pause. JavaScript is multi-threaded. It won't pause untill setTimeout() executes, the execution of rest of the script will carry on. check this link to see some techniques to achieve what you want. http://www.webdeveloper.com/forum/archive/index.php/t-33739.html
September 18, 201016 yr Author i did it u can check my home page to see the script http://www.sa7afa.net/new/ ------- hosam alaa www.sa7afa.net
Create an account or sign in to comment