jQuery Mobile: Stick footer to bottom of page

后端 未结 10 884
一个人的身影
一个人的身影 2020-12-04 09:40

Is there any way, bearing in mind the way the jQuery Mobile framework operates, to fix the page so that the footer always aligns with the bottom of the page - no matter the

10条回答
  •  独厮守ぢ
    2020-12-04 10:19

    You can add this in your css file:

    [data-role=page]{height: 100% !important; position:relative !important;}
    [data-role=footer]{bottom:0; position:absolute !important; top: auto !important; width:100%;}  
    

    So the page data-role now have 100% height, and footer is in absolute position.

    Also Yappo have wrote an excellent plugin that you can find here: jQuery Mobile in a iScroll plugin http://yappo.github.com/projects/jquery.mobile.iscroll/livedemo.html

    hope you found the answer!

    An answer update

    You can now use the data-position="fixed" attribute to keep your footer element on the bottom.
    Docs and demos: http://view.jquerymobile.com/master/demos/toolbar-fixed/

提交回复
热议问题