jQuery Mobile,打开对话框

标签 jquery jquery-mobile transition

我在使用 jQuery Mobile 转换打开时遇到问题。

我无法创建过渡效果。

这是我的代码...

    <div id="main" data-role="content" data-theme="d">
<a href="#dialog" data-role="button" data-rel="dialog" data-transition="fade" data-inline="true">dialog</a>
<!-- ... -->
<div data-role="page" id="dialog"><!-- dialog-->
    <div data-role="header" data-theme="e">
        <h1>Foo</h1>
        </div>
    <div data-role="content" data-theme="e">
        <p>Bar</p>
    </div>
</div>
<!-- Footer -->
jQuery('#page').live('pageinit', function() {
    $('.widget ul').attr('data-inset', 'true').attr('data-theme', 'd').attr('data-dividertheme', 'b').attr('data-role', 'listview');
    $('.widget ul').listview();
});
jQuery('#page').live('changepage', function() {
$('#dialog', 'pop', true, true);
});

感谢您的帮助。

问候,

五。

最佳答案

在 data-role="page"元素上,您需要添加 data-rel="dialog",而不是“id”,以使页面显示为对话框。

请参见此处:http://jquerymobile.com/test/docs/pages/page-dialogs.html

关于jQuery Mobile,打开对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9550550/

相关文章:

javascript - 链接.click();在 Chrome 中工作时无法在 Internet Explorer 中工作

css - 我怎样才能停止 jQuery Mobile 将样式应用到我的特定表单元素

JQuery mobile 按钮内的两列网格不填充宽度

java - 如何在 Android 中创建包含额外内容和过渡的 bundle

javascript - CSS 过渡突然停止

javascript - 水平滚动可用取决于屏幕上的内容

jquery - 日历 td 的自定义背景颜色

javascript - 使用 javascript 或 Jquery 从 iFrame 重定向

javascript - 创建一个通用类以将挖空对象与页面绑定(bind)

jquery - Apple Music 下一张幻灯片动画