说说zepto

153 阅读1分钟

本身的zepto比较简陋,如果使用animate,可能需要引用fx模块,如果使用tap,swipeLeft,swipeUp等触摸事件,需要引用touch模块。听说zepto可以用tap事件,它比click快,用了近一年zepto,我也没发现zepto的tap,后来换了份工作做PC端,偶然发现是因为没有引用touch模块 animate.css整个东西也比较有意思 用法

$.fn.extend({
    animateCss: function (animationName) {
        var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
        $(this).addClass('animated ' + animationName).one(animationEnd, function() {
            $(this).removeClass('animated ' + animationName);
        });
    }
});

zepto animate.css hover.css 让你的Web项目有趣起来