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.

  1. solution 1:

    • modify global settings on mobileinit, setting ignorecontentenabled 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"> 

  1. solution 2:

    • modify page widget defaults on mobileinit, setting .selector keepnative. .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 , elements native class, kept is.


demo


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -