When data-enhance="false"
is set on a parent element, it is inherited by all the child elements. To search for elements that can use manual enhancements or for custom plugin authoring, the jQuery Mobile framework provides a filter method called jqmEnhanceable()
. This recipe shows you how to use it.
Copy the full code of this recipe from the code/09/jqmenhance
source folder. You can launch this code using the URL http://localhost:8080/09/jqmenhance/main.html
.
Add the following script to
main.html
before includingj
query.mobile.js
:$(document).bind("mobileinit", function() { $.mobile.ignoreContentEnabled = true; });
Add two anchor buttons to the page as shown. The second button is within a
div
tag which hasdata-
enhance="false"
.<div data-role="content"> <div> <a href="#">Link 1</a> </div> <div data-enhance="false"> <a href="#">Link 2</a> </div> </div>
Add the following...