Description: Enhance all the children of all elements in the set of matched elements.
- This method does not accept any arguments.
This method is responsible for performing all jQuery Mobile enhancement. Given a set of DOM elements it will enhance their children with all the widgets available.
The enhancement is based on each widget's
initSelector property. This selector will be used to identify the elements upon which the widget will be instantiated.
You can shield elements and their children from enhancement by adding the attribute
data-enhance="false" to an element. This will cause it, and all its children to be ignored by
.enhanceWithin(). Unfortunately, checking elements to see whether they are children of an element that has been marked with
data-enhance="false" is performance-intensive. Thus, the presence of
data-enhance="false" will only be considered if the global flag
$.mobile.ignoreContentEnabled is set to
enhanceWithin does not attempt to resolve issues related to the order in which widgets are enhanced. For example, enhancing
filterable widgets before
checkboxradio widgets are enhanced can cause the
checkboxradio widgets to be displayed incorrectly. If this affects you, then you must ensure that the widgets which need to be enhanced early are instantiated before the rest of the widgets. One possibility for accomplishing this is to instantiate your widgets during the page widget's
Injecting new content at runtime and enhancing it with