IE和FF中的jQuery动画animatescrollLeft错误 [英] Jquery animate scrollLeft bug in IE and FF

查看:72
本文介绍了IE和FF中的jQuery动画animatescrollLeft错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试制作水平滚动动画,但是在IE和FF中出现了一个小虫,单击滚动时会出现闪光灯",看起来像以前的div一样.很难用语言解释,请参见 http://amplabusca.org/teste2/ementa.php

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 previous divs. Its hard to explain in words, see the example in http://amplabusca.org/teste2/ementa.php

为什么会这样?

推荐答案

将click-Event更改为$('#next').click(function (event) { event.preventDefault(); // Your code... });之类的内容,以防止移动锚定"标准行为.

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

这篇关于IE和FF中的jQuery动画animatescrollLeft错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆