javascript - jQuery Mobile 导致 CSS3 动画在面板显示中重新触发

标签 javascript jquery html css jquery-mobile

我正在使用 jQuery Mobile 创建侧边栏面板:

http://demos.jquerymobile.com/1.4.0/panel-fixed/

我的页面正文 (ui-content) 中有 CSS3 动画,它会在页面加载时触发:

h1.page-title{
    -webkit-animation: fade-in 1s linear;
    animation: fade-in 1s linear;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}

一切正常,除了当我单击链接以显示面板时,动画再次触发(仅一次)。谁能想到是什么原因造成的?

page-title 类是唯一的,无论如何都不会被 jQuery Mobile 引用。我只能认为它模拟了页面刷新,但是如果链接被点击两次它就不会再次刷新。

最佳答案

根据 Omar 的评论,这很有效:

Wrap content div in <div class="ui-panel-wrapper">. When opening panel for the first time, it wraps content div in a div with the aforementioned class. This happens only for data-display push and reveal, but not overlay.

关于javascript - jQuery Mobile 导致 CSS3 动画在面板显示中重新触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20724668/

相关文章:

javascript - 如何删除选择字段中的列表选项项?

jquery - 如何将一个对象附加到多个元素?

javascript - 如何使用 javascript 通过单击按钮淡出列表?

html - 转换元素后如何删除空格?

javascript - div 高度随着其他流体 div 高度的变化而变化

javascript - 当我尝试切换复选框时值不会改变

javascript - 如何在 React-Native-Render-Html 中强制标签为全 Angular ?

javascript - 实现跨域通信

javascript - RaphaelJS - 标准化 svg 路径形状大小

HTML 表单字段和边距显示