ROCKINDANO Posted July 1, 2010 Share Posted July 1, 2010 Hello all, Need help with a news ticker that i have. it reads and grabs data from a mysql table fine. the problem is when i click on next more than once it moves to fast to the other story and not give chance to read. this is my js code page: // JavaScript Document first = 0; last = 10; current = 1; function nextStory() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; // Show next picture, if last, loop back to front if (current == last) { current = 1; } else { current++ } // alert(current); object = document.getElementById('slide' + current); object.style.display = 'block'; setTimeout(nextStory, 9000); } function previousStory() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; if (current == first) { current = last; } else { current--; } object = document.getElementById('slide' + current); object.style.display = 'block'; } this is my display php page. this is just the controls <div style="clear:both; position: relative; margin-top:-8px; margin-right:15px;" class="floatright"> <a href="javascript:previousStory()" style="margin-left: 10px;"> « Prev.</a> | <a href="javascript:nextStory()" style="margin-left: 10px;"> Next » </a> | <a href="latestnews.php" style="margin-left: 10px;">All News</a> </div> can someone help me? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.