-
Notifications
You must be signed in to change notification settings - Fork 0
/
jQuery.stickyFooter.min.js
6 lines (6 loc) · 1.18 KB
/
jQuery.stickyFooter.min.js
1
2
3
4
5
6
/*!
* jQuery Sticky Footer V1.0
* Copyright (c) 2017 claudchan
* MIT license
*/
(function(b,l,m,h){function c(a,e){this.element=a;this.options=b.extend({},k,e);this._defaults=k;this._name="stickyFooter";this.init()}var k={wrapper:b("html"),container:b("body"),delay:200};b.extend(c.prototype,{init:function(){this.stickyFooter()},stickyFooter:function(){var a=b(this.element),e=this.options.wrapper,f=this.options.container,d=this.options.delay,c=function(){e.css({position:"relative","min-height":"100%"});a.css({position:"absolute",bottom:"0",margin:"0",width:"100%"});f.css("margin-bottom",a.outerHeight())},g=!1;c();b(l).on("resize",function(){g=!0});setInterval(function(){g&&(g=!1,c())},d)}});b.fn.stickyFooter=function(a){var e=arguments;if(a===h||"object"===typeof a)return this.each(function(){b.data(this,"plugin_stickyFooter")||b.data(this,"plugin_stickyFooter",new c(this,a))});if("string"===typeof a&&"_"!==a[0]&&"init"!==a){var f;this.each(function(){var d=b.data(this,"plugin_stickyFooter");d instanceof c&&"function"===typeof d[a]&&(f=d[a].apply(d,Array.prototype.slice.call(e,1)));"destroy"===a&&b.data(this,"plugin_stickyFooter",null)});return f!==h?f:this}}})(jQuery,window,document);