1

我正在使用jQuery Mobile并且在我的项目中有several pages.

我希望所有页面都share a common footer没有在每个页面中放置页脚,我希望它只在一个地方,然后它会出现在所有页面中。

这可能吗?

4

1 回答 1

0

试试这个代码:

$('[data-role=page]').on('pageshow', function (event, ui) {
            $("#" + event.target.id).find("[data-role=footer]").load("footer.html", function(){
                $("#" + event.target.id).find("[data-role=navbar]").navbar();
            });
        });

参考这篇文章

Jquery Mobile在不同页面上的相同页脚

于 2012-06-07T13:39:03.063 回答