开发者

Jquery animate scrollLeft bug in IE and FF

开发者 https://www.devze.com 2023-02-25 08:58 出处:网络
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 e

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');
});
0

精彩评论

暂无评论...
验证码 换一张
取 消