[英]jQuery Mobile common footer for all pages
I am using jQuery Mobile
and in my project there are several pages
. 我正在使用jQuery Mobile
,在我的项目中有several pages
。
I want that all pages to share a common footer
without putting the footer in each page, I want it to be at only at one place and from there it will appear in all pages. 我希望所有页面share a common footer
而不将页脚放在每个页面中,我希望它只在一个位置,然后从那里出现在所有页面中。
Is this possible? 这可能吗?
Try this code: 试试这个代码:
$('[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();
});
});
Refer to this post 参考这篇文章
Jquery Mobile Same Footer on Different Pages 不同页面上的jQuery Mobile相同页脚
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.