JQuery Mobile disable enhancement for certain tags?

I don't need styles for the tag <a>

. I found topics like How do I disable jQuery Mobile Style for <select> drop downs? But I don't want to add data-enhance=false

to every anchor I have. I also hoped that linkBindingEnabled

would work (from http://jquerymobile.com/ demos / 1.2.0 / docs / api / globalconfig.html ) as it does not add custom classes to the <a>

tag.

I can remove definitions in a CSS file, but I would prefer a programmatic way to do it. For example, I will comment .ui-body-c .ui-link

(default link) but my footer links are still expanded. And I'm sure there are other small cases and I don't want this to be messy (although sometimes this is the only option)

Basically, is there a way to disable the extension for the "selector" of elements? Instead of manually addingdata-enhance=false

+3


source to share


2 answers


There are several ways to disable markup boosting in , but in your case there is only one solution: jQuery Mobile

$(document).on('pagebeforeshow', '#index', function(){       
   $('a').removeClass('ui-link');
});

      

jsFiddle

example: http://jsfiddle.net/Gajotres/L4KUT/



More solutions can be found in my friend ARTICLE , to be transparent, this is my personal blog. Or find it HERE . Chapter Search: Methods to Prevent Markup Boost .

There you will find an answer on how to disable it at the selector level, unfortunately it only works on native form elements and the tag is not a native form element:

$(document).bind('mobileinit',function(){
     $.mobile.page.prototype.options.keepNative = "select, input";
});  

      

+5


source


To turn off select component promotion you can add data-role='none'

tested on jQuery Mobile 1.4.2.



see http://jsfiddle.net/zLZzA/1/

+5


source







All Articles