简体   繁体   中英

jQuery Mobile common footer for all pages

I am using jQuery Mobile and in my project there are 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM