jQuery Mobile rendering problems with content being added after the page is initialized

后端 未结 11 1950
清酒与你
清酒与你 2020-12-14 18:54

I\'m using jQuery Mobile and Backbone JS for a project. It\'s mostly working, using jQuery Mobile\'s event \'pagebeforeshow\' to trigger the correct Backbone View. In the Ba

相关标签:
11条回答
  • 2020-12-14 19:20

    update

    Since jQueryMobile beta2 there is an event to do this. .trigger('create') on an element to cause everything inside it to be painted correctly.

    Another question that is not a duplicate, but requires an answet I posted over 10 times :)

    [old answer]

    try .page()

    More details in my faq: http://jquerymobiledictionary.pl/faq.html

    0 讨论(0)
  • 2020-12-14 19:22

    JQuery Mobile now supports .trigger("create"); which will resolve this for you

    0 讨论(0)
  • Try use enhanceWithin() method. This should be method of any jQuery object while using jQuery Mobile.

    0 讨论(0)
  • 2020-12-14 19:26

    Try calling .trigger("create") on the element with the new content.

    0 讨论(0)
  • 2020-12-14 19:26

    I needed a way to dynamically refresh a JQM page after it had been initialized. I found that if I removed the data attribute "page" during the "pagehide" event, the next time the JQM page was displayed it was re-initialzed.

    $('#testing').live('pagehide', function (e) {
        $.removeData(e.target, 'page');
    }); 
    
    0 讨论(0)
提交回复
热议问题