Animate scrollLeft get problems in IE and FF

Animate scrollLeft get problems in IE and FF

I´m trying animate horizontal scroll. I use this code:

  1. <script type="text/javascript" src="jquery-1.5.2.min.js" ></script>
  2. <script type="text/javascript">
  3. $(document).ready(function() {
  4.  var margin = 0;
  5.  var width  = $('body').width();
  6.  
  7.     $('#next').click(function() {
  8. margin +=width;
  9.         $('html, body').stop().animate({scrollLeft:"+="+500},1000);
  10. $("#prev a").css('visibility','visible');
  11.     });
  12.     $('#prev').click(function() {
  13. margin -=width;
  14.         $('html, body').stop().animate({scrollLeft:"-="+500},1000);
  15. if(margin<200){$("#prev a").css('visibility','hidden');}
  16.     });
  17. });
  18. </script>
In firefox and IE, gets a little bug whin click to scroll, like a ghost of previous divs. This hard trying explain, see the example: