Hello there
I have noticed something that rubs me the wrong way in jquery.meanmenu.js
The code in that file is wrapped in a IIFE like so ...
(function ($) {
// Bunch of code
})(jQuery);
However, inside the code of the plugin, there is not a single place where the $ variable is being used when performing jQuery searches.
For instance, when initializing the defaults, it is done like this ...
var defaults = {
meanMenuTarget: jQuery(this),
// etc.
};
Instead, a better way of doing this would be ...
var defaults = {
meanMenuTarget: $(this),
// etc.
};
I believe that using the $ will avoid issues when more than one version of jQuery are being used in the same page ... in which case, $ will refer to the actual jQuery being used to initialize meanmenu instead of the global/default jQuery, which might not be compatible with meanmenu.
Cheers
Hello there
I have noticed something that rubs me the wrong way in jquery.meanmenu.js
The code in that file is wrapped in a IIFE like so ...
However, inside the code of the plugin, there is not a single place where the
$variable is being used when performing jQuery searches.For instance, when initializing the defaults, it is done like this ...
Instead, a better way of doing this would be ...
I believe that using the
$will avoid issues when more than one version of jQuery are being used in the same page ... in which case,$will refer to the actual jQuery being used to initialize meanmenu instead of the global/default jQuery, which might not be compatible with meanmenu.Cheers