Forcing jQuery Mobile to re-evaluate styles/theme on dynamically inserted content

前端 未结 7 954
感情败类
感情败类 2020-11-28 04:40

Objective: Load HTML content via $.ajax, insert it into the DOM, have jQuery Mobile apply theme styles to it.

Problem:

相关标签:
7条回答
  • 2020-11-28 05:42

    For others searching for an answer for this, as of 6/9/2011 the jQuery mobile team has implemented this feature in a development branch. According to this issue, it will work in this manor:

    $(".ui-content").append( ... lots of HTML ...).trigger( "enhance" );

    https://github.com/jquery/jquery-mobile/issues/1799

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