Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #170 from SimenB/umd
Browse files Browse the repository at this point in the history
Add UMD wrapper
  • Loading branch information
garand committed Aug 17, 2015
2 parents 7136048 + 121ca22 commit 5002149
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions jquery.sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@
// It will only set the 'top' and 'position' of your element, you
// might need to adjust the width in some cases.

(function($) {
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var slice = Array.prototype.slice; // save ref to original slice()
var splice = Array.prototype.splice; // save ref to original slice()

Expand Down Expand Up @@ -212,4 +223,4 @@
$(function() {
setTimeout(scroller, 0);
});
})(jQuery);
}));

0 comments on commit 5002149

Please sign in to comment.