Jquery CSS and JS to limited elements -
i want apply jquery mobile css , js limited elements , no other elements on page. idea how can that.
i have salesforce standard customer portal in including tab having jquery ,mobile , css.
now when open tab in customer portal , overrides salesforce standard styling.
thanks
depending on jquery mobile version you're using.
solution 1:
modify global settings on
mobileinit
, settingignorecontentenabled
true. however, affects app performance negatively, slows down processing/initializing widgets/elements.<head> <script src="jquery.js"></script> <script> $(document).on("mobileinit", function () { $.mobile.ignorecontentenabled = true; }); </script> <script src="jquery-mobile.js"></script> <head>
add
data-enhance="false"
elements or div want keep untouched jqm.<div data-role="content" data-enhance="false"> <!-- elements --> </div> <input type="text" data-enhance="false">
solution 2:
modify page widget defaults on
mobileinit
, setting .selectorkeepnative
. .selector<tag>
,#id
or.class
.jquery mobile <= 1.3.x
<head> <script src="jquery.js"></script> <script> $(document).on("mobileinit", function () { $.mobile.page.prototype.options.keepnative = $.mobile.page.prototype.options.keepnative + ", input, #foo, .native"; }); </script> <script src="jquery-mobile.js"></script> <head>
jquery mobile >= 1.4.x
<head> <script src="jquery.js"></script> <script> $(document).on("mobileinit", function () { $.mobile.keepnative = $.mobile.keepnative + ", input, #foo, .native"; }); </script> <script src="jquery-mobile.js"></script> <head>
when page being created,
input
, element#foo
id , elementsnative
class, kept is.
Comments
Post a Comment