!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function e(a){var b=a.prop("clientWidth"),c=a.prop("offsetWidth"),d=parseInt(a.css("border-right-width"),10),e=parseInt(a.css("border-left-width"),10);return c>b+e+d}var b="onmousewheel"in window?"ActiveXObject"in window?"wheel":"mousewheel":"DOMMouseScroll",c=".scrollLock",d=a.fn.scrollLock;a.fn.scrollLock=function(d,f,g){return"string"!=typeof f&&(f=null),void 0!==d&&!d||"off"===d?this.each(function(){a(this).off(c)}):this.each(function(){a(this).on(b+c,f,function(b){if(!b.ctrlKey){var c=a(this);if(g===!0||e(c)){b.stopPropagation();var d=c.scrollTop(),f=c.prop("scrollHeight"),h=c.prop("clientHeight"),i=b.originalEvent.wheelDelta||-1*b.originalEvent.detail||-1*b.originalEvent.deltaY,j=0;if("wheel"===b.type){var k=c.height()/a(window).height();j=b.originalEvent.deltaY*k}(i>0&&0>=d+j||0>i&&d+j>=f-h)&&(b.preventDefault(),j&&c.scrollTop(d+j))}}})})},a.fn.scrollLock.noConflict=function(){return a.fn.scrollLock=d,this}});