I trying animate a horizontal scroll, but get a litle bug in IE and FF, when click to scroll, gets a "flash" looks like a ghost of开发者_JS百科 previous divs. Its hard to explain in words, see the example in http://amplabusca.org/teste2/ementa.php
Why does this happen?
Change your click-Event to something like $('#next').click(function (event) { event.preventDefault(); // Your code... });
to prevent the "move to anchor" standard behavior.
$('#next').click(function(event) {
event.preventDefault();
margin +=width;
$('html, body').stop().animate({scrollLeft:"+="+500},1000);
$("#prev a").css('visibility','visible');
});
精彩评论