diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 9d6a778..ad6ade7 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -2,7 +2,15 @@ * Licensed under the MIT License */ 'use strict'; -((function ($) { +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { // The default settings for the plugin var defaultSettings = { @@ -432,4 +440,4 @@ return $this; }); }; -})(jQuery)); +}));