Codeinwp / carouFredSel-jQuery

A circular, responsive carousel plugin built using the jQuery.
http://caroufredsel.dev7studios.com
Other
318 stars 476 forks source link

jQuery noConflict(true) compatibility #13

Open fsencinas opened 10 years ago

fsencinas commented 10 years ago

if jQuery noConflict with "remove all" flag (set to true) is used, caroufredsel throws an error (invalid 'instanceof' operand jQuery) due de following mismatch: inside helper function "is_jquery" the instanceof jQuery is checking against alias jQuery (global), so as per jQuery (global) is no longer available due noConfict(true), then a local jQuery alias must be declared (inside caroufredsel closure) or just use $ instead.

(function($) {
    var jQuery = $; // <----  local jQuery alias scope

    //  LOCAL
    if ( $.fn.carouFredSel )
        ....

or

    function is_jquery(a) {
        return (a instanceof $); // <---  instead jQuery "glob alias"
                ...