【问题标题】:JQM RC2 data-role="header" not styling with dynamic loadJQM RC2 data-role="header" 不是动态加载的样式
【发布时间】:2012-09-24 03:58:35
【问题描述】:

我的简单“页眉”或“页脚”都没有设置样式:所有其他小部件(控件组、可折叠集、列表等)的样式都符合预期。

我正在重新加载 data-role="page" 中的所有内容 然后像这样重建页面

$("#standings").load(url, function (content, status) {
        $("#standings").trigger("create");
        $.mobile.hidePageLoadingMsg();
});

data-role='content' 样式中的所有内容在加载时都很好。我在正确样式的内容之外有两个“控制组”,但页眉或页脚都没有选择任何样式。

【问题讨论】:

    标签: jquery-mobile


    【解决方案1】:

    我认为您应该使用trigger("pagecreate") 而不是trigger("create")...即使通常不建议这样做...:S

    所以,你会得到这样的东西:

    $("#standings").load(url, function (content, status) {
            $("#standings").trigger("pagecreate");
            $.mobile.hidePageLoadingMsg();
    });
    

    我想你可能想看看这个链接:https://github.com/jquery/jquery-mobile/issues/2703


    否则,您可以尝试将类直接应用到您的标题中。

    查看此链接了解更多信息:JQuery Mobile trigger('create') command not working


    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多