Mam taki kod do zmiany wyświetlania kolejnych newsów

  1. <script language="javascript" type="text/javascript">
  2. var headline_count;
  3. var headline_interval;
  4. var old_headline = 0;
  5. var current_headline = 0;
  6.  
  7.  
  8. $(document).ready(function(){
  9. headline_count = $("div.recommend").size();
  10.  
  11. headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
  12. $('#newsy').hover(function() {
  13. clearInterval(headline_interval);
  14. }, function() {
  15. headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
  16. });
  17. });
  18.  
  19. function headline_rotate() {
  20. current_headline = (old_headline + 1) % headline_count;
  21. $("div.recommend:eq(" + old_headline + ")").toggle();
  22. $("div.recommend:eq(" + current_headline + ")").toggle();
  23. old_headline = current_headline;
  24. }
  25. </script>

Wszystko ładnie działa, jedyny problem w tym, że przy zmianie newsa przeglądarka przenosi na górę strony. Jak temu zaradzić?