Giter VIP home page Giter VIP logo

jqmulti's Introduction

////////////////////////////////////////////
//
//  jQuery Multi
//
////////////////////////////////////////////

-- SUMMARY --

Need to use a higher version of jQuery for your module or theme than the one provided by Drupal/jQuery Update?

jQuery Multi allows you to load an extra version of the jQuery library in parallel to Drupal's version, without 
conflicting with Drupal's version. You can then choose any JavaScript library or files to use the new version
of jQuery. No need to alter packaged jQuery plugins!

-- INSTALLATION --

  1. Place a version of the minified jQuery library in the libraries folder, so that
     the path to the actual jQuery library will be: sites/all/libraries/jquery/jquery-<version>.min.js
  2. Download and install jQuery Multi in the usual fashion.

-- USAGE --

  1. Enable the module.
  2. Navigate to the settings page at admin/config/settings/jqmulti.
  3. Ensure that your jQuery library has been detected.
  
  4. To target certain JavaScript files to run with the jQuery Multi version, choose
     one of the following methods:
  
    A) Put the JS in sites/all/libraries/ and use the UI at admin/config/system/jqmulti
       to select your library. All the library's JS files will be loaded with the jqmulti jQuery version. 
       There is no need to use the alias in this case. This is ideal if you're using a 
       prepackaged jQuery library or plugin.
    B) Put the JS in sites/all/libraries/ and use hook_jqmulti_libraries() to include the library.
       No need to use the alias. This is ideal if you're using a prepackaged jQuery library or plugin,
       and is equivalent to method A.
    C) Put the JS anywhere else, like in a custom module, and use hook_jqmulti_files() to load it. No need to use the alias.
    D) Put the JS anywhere, use the provided alias, and don't use the jqmulti hooks or UI. Simply load 
       with drupal_add_js() or something similar. If you're only using this method, make sure to select
       the 'Load Always' checkbox in the jQuery Multi config.

        To use the automatically provided jQuery alias in your custom scripts:
  
            Use the version of jQuery loaded by jQuery Multi in your custom scripts by referencing
            the automatically provided alias in your script closure. The alias names are
            generated using the jQuery version number, with the periods removed.
  
            For instance, if you're loading jQuery-1.7.1, the alias will be jq171, and you can
            use it in your scripts by wrapping your code as follows:
  
            (function($){
              // your code here, using jQuery 1.7.1
            })(jq171)
    
  NOTE: Loading libraries with Jquery Multi will only load the JS files within the library. You must
        call drupal_add_css() separately to load any included CSS files that may be in the library.

  NOTE: All jQuery targeted to use jQuery Multi (using methods A, B, or C above) must properly use a 
        closure around the jQuery code, as is best practice for all Drupal jQuery code, i.e.:
        
            (function($){
              // your code here, using jQuery 1.7.1
            })(jQuery)

  

jqmulti's People

Contributors

guyoron avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

jqmulti's Issues

Can I run this module along with jquery update module?

I have jquery update module. I am using default drupal version for admin pages and 1.7 for the site. I wanted to use bootstrap and it requires 1.9. After some search I found jqmulti module. I downloaded library 1.9.0. Extracted library and enabled the module. When I go to config page of jqmulti, it shows jquery 1.8.2.ajax_xhr. I have 2 questions.

  1. Is it ok to do this?

  2. I downloaded jquery 1.9 from github, but it is showing 1.8.2. Why?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.