From c7ed6dec7ca9718b4b8c6bdccda2b4a92d8e610f Mon Sep 17 00:00:00 2001 From: xwartz Date: Wed, 16 Mar 2016 16:01:37 +0800 Subject: [PATCH] add amd support --- src/js/unslider.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/unslider.js b/src/js/unslider.js index d09018e..8cc25b4 100755 --- a/src/js/unslider.js +++ b/src/js/unslider.js @@ -7,7 +7,10 @@ (function(factory) { if (typeof module === 'object' && typeof module.exports === 'object') { factory(require('jquery')); - } else { + } else if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], factory(window.jQuery)); + } else { factory(window.jQuery); } }(function($) {