1/* 2 Title: Window Resize End Plugin 3 Version: 1.0 4 Created on: May 08, 2014 5 Author: Manoj Babu Balaraman 6 Copyright: Verndale. 7 8*/ 9 10(function ($) { 11 $.windowResizeEnd = function (el, options) { 12 //base settings 13 var base = this; 14 15 base.$el = $(el); 16 base.el = el; 17 18 base.$el.data("windowResizeEnd", base); 19 base.rtime = new Date(1, 1, 2000, 12, 00, 00); 20 base.timeout = false; 21 base.delta = 400; 22 23 //Intializing the method 24 base.init = function () { 25 base.options = $.extend({}, $.windowResizeEnd.defaultOptions, options); 26 27 if (base.options.runOnStart) base.options.onDragEnd(); 28 29 $(base.el).resize(function () { 30 base.rtime = new Date(); 31 if (base.timeout === false) { 32 base.timeout = true; 33 setTimeout(base.windowResizeEnd, base.delta); 34 } 35 }); 36 37 }; 38 39 //Executing the whether the window resize is done/not 40 base.windowResizeEnd = function () { 41 if (new Date() - base.rtime < base.delta) { 42 setTimeout(base.windowResizeEnd, base.delta); 43 } else { 44 base.timeout = false; 45 base.options.onDragEnd(); 46 } 47 }; 48 49 //Intializing the init method 50 base.init(); 51 }; 52 53 //by Default options 54 $.windowResizeEnd.defaultOptions = { 55 onDragEnd: function () {}, 56 runOnStart: false 57 }; 58 59 //executing the resize method options onload of browser window 60 $.fn.windowResizeEnd = function (options) { 61 return this.each(function () { 62 (new $.windowResizeEnd(this, options)); 63 }); 64 }; 65 66})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.