首页 > 微信浏览器 animationend 事件不响应

微信浏览器 animationend 事件不响应

http://lishengzxc.bitbucket.org/6-9-5/

demo地址

购物车页面 最下面有一个slide,我自己写的,写了一个动画结束的响应事件animationend,其他浏览器都正常,微信浏览器发现不会响应这个动画结束事件
我的相关代码

var slideStep1 = function(index, s, d) {...};

var slideStpe2 = function(index, s, d) {...};

var moveIndex = function(index, s, d) {...};

var slide = function(event) {
    if (!event) {
        direction = 'left';
    } else {
        if (startX - event.touches[0].pageX > 0) {
            direction = 'left'
        } else {
            direction = 'right'
        }
    }
    if (animationFlag) {
        animationFlag = false;
        var s = e[0].children;
        index = 0;
        for (var i = 0; i < s.length - 1; i++) {
            if (s[i].classList.contains('in')) {
                index = i;
                break;
            }
        }
        slideStep1(index, s, direction);
    }
};
e.on('touchstart', function(event) {
    startX = event.touches[0].pageX;
});
e.on('touchmove', slide);
e.on('webkitAnimationEnd', function(event) {
    var s = e[0].children;
    slideStpe2(index, s, direction);
    moveIndex(index, s, direction);
    animationFlag = true;
});
e.on('animationend', function(event) {
    var s = e[0].children;
    slideStpe2(index, s, direction);
    moveIndex(index, s, direction);
    animationFlag = true;
});
setInterval(slide, 2000);

我的操作主要是 添加 class名,然后就会执行动画,动画结束后 做一定的操作,但是微信浏览器中,不响应animationend


自己搞定了,我发现其实我是知道动画的播放时间的,那我就用settimeout就行了

【热门文章】
【热门文章】