JQuery Version Conflict

前端 未结 3 767
广开言路
广开言路 2021-02-06 11:58

I am trying to use the Nivo JQuery Slider (http://nivo.dev7studios.com/) and a Scrollable Gallery (http://flowplayer.org/tools/demos/scrollable/index.html).

Now I have

3条回答
  •  忘了有多久
    2021-02-06 12:21

    use this solution if you cannot use a single jQuery file for both the plugins:

    
    
    
    

    To use jQuery 1.4.2, put the code using it in a SEF (Self Executing Function) like this:

    (function($){
       //code using jQuery 1.4.2
       //here the $variable will be the jQuery object of 1.4.2
    })(jQuery_1_4_2)
    

    For jQuery 1.2.5, you can use $ variable directly.

    UPDATE: Based on your comment, following is the way to use it.

    If you want to use jQuery 1.4.2, use jQuery_1_4_2 object
    For example: jQuery_1_4_2("#abc").slider(options)

    If you want to use jQuery 1.2.5 use $ or jQuery object
    For example: $("#abc").scrollable(options)

提交回复
热议问题