jquery - 不能重复动画 - jQuery

标签 jquery jquery-plugins css jquery-animate css-transitions

我不能用下面的例子重复动画(使用 jQuery Transit )

$("#rotateDiv2").button().click(function() {
    $('#second').transition({
        perspective: '100px',
        easing: 'snap',
        duration: '3000ms',
        rotate3d: '1, 1, 0, 360deg'
    });
});

它确实有效,但只有效一次(当然是在单击按钮时)。我第二次点击它什么都不做。谢谢!!

最佳答案

您可以在回调中重置 CSS 转换属性:

http://jsfiddle.net/zA2ZQ/2/

$("#rotateDiv2").button().click(function() {
    $('#second').transition({
        perspective: '100px',
        easing: 'snap',
        duration: '3000ms',
        rotate3d: '1, 1, 0, 360deg'
    }, function(){
      //reset the transform property
      $(this).css('transform', '');
    });
});​

关于jquery - 不能重复动画 - jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11579287/

相关文章:

javascript - jquery背景图片改变淡出

javascript - 转换 jQuery 和 vanilla js

javascript - 日期选择器后模糊事件

jquery - 将节点从 jstree 拖到外部 div 元素上,然后在放下时执行操作

Jquery可排序自动排序

jquery-plugins - 如何使用 Cloudinary jQuery 插件直接从页面上传图像?

javascript - CSS 折叠类别列表

javascript - 如何从 XHTML 中的 Document.Write 中删除 Div 和 Img 标签

javascript - 使用 js 和 css 隐藏/显示 div 中的内容

html - 如何在 HTML 中移动视频的中心?