Jquery Mobile 1.4.1 dynamic header

前端 未结 1 569
Happy的楠姐
Happy的楠姐 2020-11-30 15:31

I\'m trying to append my header (date-role=header) dynamically in jquery mobile 1.4.1. I\'m adding a button to the right side of it and I\'m using $(\'#pa

相关标签:
1条回答
  • 2020-11-30 16:19

    The way to insert toolbars in jQuery Mobile 1.4 is different, .toolbar() function should be called on header/footer inserted dynamically.

    $("[data-role=header], [data-role=footer]").toolbar();
    

    And then, page's height should be reset as toolbars add padding to page causing page to scroll.

    $.mobile.resetActivePageHeight();
    

    The .trigger("pagecreate") and .trigger("create") are deprecated and replaced with .enhanceWithin(). The new function should be called on parent div containing the dynamically add elements.

    0 讨论(0)
提交回复
热议问题