diff --git a/min/perfect-scrollbar-0.4.1.min.js b/min/perfect-scrollbar-0.4.1.min.js deleted file mode 100644 index 711bfdd..0000000 --- a/min/perfect-scrollbar-0.4.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! perfect-scrollbar - v0.4.1 -* http://noraesae.github.com/perfect-scrollbar/ -* Copyright (c) 2013 HyeonJe Jun; Licensed MIT */ -(function(e){var t={wheelSpeed:10,wheelPropagation:!1};e.fn.perfectScrollbar=function(o,r){return this.each(function(){var l=e.extend(!0,{},t);if("object"==typeof o?e.extend(!0,l,o):r=o,"update"===r)return e(this).data("perfect-scrollbar-update")&&e(this).data("perfect-scrollbar-update")(),e(this);if("destroy"===r)return e(this).data("perfect-scrollbar-destroy")&&e(this).data("perfect-scrollbar-destroy")(),e(this);if(e(this).data("perfect-scrollbar"))return e(this).data("perfect-scrollbar");var n,s,a,c,i,p,f,u,d=e(this).addClass("ps-container"),h=e("
").appendTo(d),g=e("").appendTo(d),v=parseInt(h.css("bottom"),10),b=parseInt(g.css("right"),10),m=function(){var e=parseInt(u*c/s,10);d.scrollTop(e),h.css({bottom:v-e})},w=function(){var e=parseInt(p*a/n,10);d.scrollLeft(e),g.css({right:b-e})},T=function(){h.css({left:p+d.scrollLeft(),bottom:v-d.scrollTop(),width:i}),g.css({top:u+d.scrollTop(),right:b-d.scrollLeft(),height:f})},C=function(){n=d.width(),s=d.height(),a=d.prop("scrollWidth"),c=d.prop("scrollHeight"),a>n?(i=parseInt(n*n/a,10),p=parseInt(d.scrollLeft()*n/a,10)):(i=0,p=0,d.scrollLeft(0)),c>s?(f=parseInt(s*s/c,10),u=parseInt(d.scrollTop()*s/c,10)):(f=0,u=0,d.scrollTop(0)),u>=s-f&&(u=s-f),p>=n-i&&(p=n-i),T()},I=function(e,t){var o=e+t,r=n-i;p=0>o?0:o>r?r:o,h.css({left:p+d.scrollLeft()})},L=function(e,t){var o=e+t,r=s-f;u=0>o?0:o>r?r:o,g.css({top:u+d.scrollTop()})},y=function(){var t,o;h.bind("mousedown.perfect-scroll",function(e){o=e.pageX,t=h.position().left,h.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){h.hasClass("in-scrolling")&&(w(),I(t,e.pageX-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){h.hasClass("in-scrolling")&&h.removeClass("in-scrolling")})},P=function(){var t,o;g.bind("mousedown.perfect-scroll",function(e){o=e.pageY,t=g.position().top,g.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){g.hasClass("in-scrolling")&&(m(),L(t,e.pageY-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){g.hasClass("in-scrolling")&&g.removeClass("in-scrolling")})},D=function(){var e=function(e,t){var o=d.scrollTop();if(0===o&&t>0&&0===e)return!l.wheelPropagation;if(o>=c-s&&0>t&&0===e)return!l.wheelPropagation;var r=d.scrollLeft();return 0===r&&0>e&&0===t?!l.wheelPropagation:r>=a-n&&e>0&&0===t?!l.wheelPropagation:!0};d.bind("mousewheel.perfect-scroll",function(t,o,r,n){d.scrollTop(d.scrollTop()-n*l.wheelSpeed),d.scrollLeft(d.scrollLeft()+r*l.wheelSpeed),C(),e(r,n)&&t.preventDefault()})},X=function(){var t=function(e,t){d.scrollTop(d.scrollTop()-t),d.scrollLeft(d.scrollLeft()-e),C()},o={},r=0,l={},n=null,s=!1;e(window).bind("touchstart.perfect-scroll",function(){s=!0}),e(window).bind("touchend.perfect-scroll",function(){s=!1}),d.bind("touchstart.perfect-scroll",function(e){var t=e.originalEvent.targetTouches[0];o.pageX=t.pageX,o.pageY=t.pageY,r=(new Date).getTime(),null!==n&&clearInterval(n),e.stopPropagation()}),d.bind("touchmove.perfect-scroll",function(e){if(!s&&1===e.originalEvent.targetTouches.length){var n=e.originalEvent.targetTouches[0],a={};a.pageX=n.pageX,a.pageY=n.pageY;var c=a.pageX-o.pageX,i=a.pageY-o.pageY;t(c,i),o=a;var p=(new Date).getTime();l.x=c/(p-r),l.y=i/(p-r),r=p,e.preventDefault()}}),d.bind("touchend.perfect-scroll",function(){n=setInterval(function(){return.01>Math.abs(l.x)&&.01>Math.abs(l.y)?(clearInterval(n),void 0):(t(30*l.x,30*l.y),l.x*=.8,l.y*=.8,void 0)},10)})},Y=function(){h.remove(),g.remove(),d.unbind(".perfect-scroll"),e(window).unbind(".perfect-scroll"),d.data("perfect-scrollbar",null),d.data("perfect-scrollbar-update",null),d.data("perfect-scrollbar-destroy",null)},x=function(t){d.addClass("ie").addClass("ie"+t);var o=function(){var t=function(){e(this).addClass("hover")},o=function(){e(this).removeClass("hover")};d.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),h.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),g.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o)},r=function(){T=function(){h.css({left:p+d.scrollLeft(),bottom:v,width:i}),g.css({top:u+d.scrollTop(),right:b,height:f}),h.hide().show(),g.hide().show()},m=function(){var e=parseInt(u*c/s,10);d.scrollTop(e),h.css({bottom:v}),h.hide().show()},w=function(){var e=parseInt(p*a/n,10);d.scrollLeft(e),g.hide().show()}};6===t&&(o(),r())},S=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),A=function(){var e=navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);e&&"msie"===e[1]&&x(parseInt(e[2],10)),C(),y(),P(),S&&X(),d.mousewheel&&D(),d.data("perfect-scrollbar",d),d.data("perfect-scrollbar-update",C),d.data("perfect-scrollbar-destroy",Y)};return A(),d})}})(jQuery); \ No newline at end of file diff --git a/min/perfect-scrollbar-0.4.1.with-mousewheel.min.js b/min/perfect-scrollbar-0.4.1.with-mousewheel.min.js deleted file mode 100644 index 65586c0..0000000 --- a/min/perfect-scrollbar-0.4.1.with-mousewheel.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! perfect-scrollbar - v0.4.1 -* http://noraesae.github.com/perfect-scrollbar/ -* Copyright (c) 2013 HyeonJe Jun; Licensed MIT */ -(function(e){var t={wheelSpeed:10,wheelPropagation:!1};e.fn.perfectScrollbar=function(o,r){return this.each(function(){var n=e.extend(!0,{},t);if("object"==typeof o?e.extend(!0,n,o):r=o,"update"===r)return e(this).data("perfect-scrollbar-update")&&e(this).data("perfect-scrollbar-update")(),e(this);if("destroy"===r)return e(this).data("perfect-scrollbar-destroy")&&e(this).data("perfect-scrollbar-destroy")(),e(this);if(e(this).data("perfect-scrollbar"))return e(this).data("perfect-scrollbar");var l,s,a,c,i,p,f,u,d=e(this).addClass("ps-container"),h=e("").appendTo(d),v=e("").appendTo(d),g=parseInt(h.css("bottom"),10),b=parseInt(v.css("right"),10),m=function(){var e=parseInt(u*c/s,10);d.scrollTop(e),h.css({bottom:g-e})},w=function(){var e=parseInt(p*a/l,10);d.scrollLeft(e),v.css({right:b-e})},T=function(){h.css({left:p+d.scrollLeft(),bottom:g-d.scrollTop(),width:i}),v.css({top:u+d.scrollTop(),right:b-d.scrollLeft(),height:f})},L=function(){l=d.width(),s=d.height(),a=d.prop("scrollWidth"),c=d.prop("scrollHeight"),a>l?(i=parseInt(l*l/a,10),p=parseInt(d.scrollLeft()*l/a,10)):(i=0,p=0,d.scrollLeft(0)),c>s?(f=parseInt(s*s/c,10),u=parseInt(d.scrollTop()*s/c,10)):(f=0,u=0,d.scrollTop(0)),u>=s-f&&(u=s-f),p>=l-i&&(p=l-i),T()},I=function(e,t){var o=e+t,r=l-i;p=0>o?0:o>r?r:o,h.css({left:p+d.scrollLeft()})},y=function(e,t){var o=e+t,r=s-f;u=0>o?0:o>r?r:o,v.css({top:u+d.scrollTop()})},C=function(){var t,o;h.bind("mousedown.perfect-scroll",function(e){o=e.pageX,t=h.position().left,h.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){h.hasClass("in-scrolling")&&(w(),I(t,e.pageX-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){h.hasClass("in-scrolling")&&h.removeClass("in-scrolling")})},P=function(){var t,o;v.bind("mousedown.perfect-scroll",function(e){o=e.pageY,t=v.position().top,v.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){v.hasClass("in-scrolling")&&(m(),y(t,e.pageY-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){v.hasClass("in-scrolling")&&v.removeClass("in-scrolling")})},D=function(){var e=function(e,t){var o=d.scrollTop();if(0===o&&t>0&&0===e)return!n.wheelPropagation;if(o>=c-s&&0>t&&0===e)return!n.wheelPropagation;var r=d.scrollLeft();return 0===r&&0>e&&0===t?!n.wheelPropagation:r>=a-l&&e>0&&0===t?!n.wheelPropagation:!0};d.bind("mousewheel.perfect-scroll",function(t,o,r,l){d.scrollTop(d.scrollTop()-l*n.wheelSpeed),d.scrollLeft(d.scrollLeft()+r*n.wheelSpeed),L(),e(r,l)&&t.preventDefault()})},x=function(){var t=function(e,t){d.scrollTop(d.scrollTop()-t),d.scrollLeft(d.scrollLeft()-e),L()},o={},r=0,n={},l=null,s=!1;e(window).bind("touchstart.perfect-scroll",function(){s=!0}),e(window).bind("touchend.perfect-scroll",function(){s=!1}),d.bind("touchstart.perfect-scroll",function(e){var t=e.originalEvent.targetTouches[0];o.pageX=t.pageX,o.pageY=t.pageY,r=(new Date).getTime(),null!==l&&clearInterval(l),e.stopPropagation()}),d.bind("touchmove.perfect-scroll",function(e){if(!s&&1===e.originalEvent.targetTouches.length){var l=e.originalEvent.targetTouches[0],a={};a.pageX=l.pageX,a.pageY=l.pageY;var c=a.pageX-o.pageX,i=a.pageY-o.pageY;t(c,i),o=a;var p=(new Date).getTime();n.x=c/(p-r),n.y=i/(p-r),r=p,e.preventDefault()}}),d.bind("touchend.perfect-scroll",function(){l=setInterval(function(){return.01>Math.abs(n.x)&&.01>Math.abs(n.y)?(clearInterval(l),void 0):(t(30*n.x,30*n.y),n.x*=.8,n.y*=.8,void 0)},10)})},X=function(){h.remove(),v.remove(),d.unbind(".perfect-scroll"),e(window).unbind(".perfect-scroll"),d.data("perfect-scrollbar",null),d.data("perfect-scrollbar-update",null),d.data("perfect-scrollbar-destroy",null)},Y=function(t){d.addClass("ie").addClass("ie"+t);var o=function(){var t=function(){e(this).addClass("hover")},o=function(){e(this).removeClass("hover")};d.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),h.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),v.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o)},r=function(){T=function(){h.css({left:p+d.scrollLeft(),bottom:g,width:i}),v.css({top:u+d.scrollTop(),right:b,height:f}),h.hide().show(),v.hide().show()},m=function(){var e=parseInt(u*c/s,10);d.scrollTop(e),h.css({bottom:g}),h.hide().show()},w=function(){var e=parseInt(p*a/l,10);d.scrollLeft(e),v.hide().show()}};6===t&&(o(),r())},S=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),E=function(){var e=navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);e&&"msie"===e[1]&&Y(parseInt(e[2],10)),L(),C(),P(),S&&x(),d.mousewheel&&D(),d.data("perfect-scrollbar",d),d.data("perfect-scrollbar-update",L),d.data("perfect-scrollbar-destroy",X)};return E(),d})}})(jQuery),function(e){function t(t){var o=t||window.event,r=[].slice.call(arguments,1),n=0,l=0,s=0;return t=e.event.fix(o),t.type="mousewheel",o.wheelDelta&&(n=o.wheelDelta/120),o.detail&&(n=-o.detail/3),s=n,void 0!==o.axis&&o.axis===o.HORIZONTAL_AXIS&&(s=0,l=-1*n),void 0!==o.wheelDeltaY&&(s=o.wheelDeltaY/120),void 0!==o.wheelDeltaX&&(l=-1*o.wheelDeltaX/120),r.unshift(t,n,l,s),(e.event.dispatch||e.event.handle).apply(this,r)}var o=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var r=o.length;r;)e.event.fixHooks[o[--r]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=o.length;e;)this.addEventListener(o[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=o.length;e;)this.removeEventListener(o[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery); \ No newline at end of file diff --git a/min/perfect-scrollbar-0.4.1.min.css b/min/perfect-scrollbar-0.4.2.min.css similarity index 97% rename from min/perfect-scrollbar-0.4.1.min.css rename to min/perfect-scrollbar-0.4.2.min.css index 86ec608..1eb323e 100644 --- a/min/perfect-scrollbar-0.4.1.min.css +++ b/min/perfect-scrollbar-0.4.2.min.css @@ -1,4 +1,4 @@ -/*! perfect-scrollbar - v0.4.1 +/*! perfect-scrollbar - v0.4.2 * http://noraesae.github.com/perfect-scrollbar/ * Copyright (c) 2013 HyeonJe Jun; Licensed MIT */ diff --git a/min/perfect-scrollbar-0.4.2.min.js b/min/perfect-scrollbar-0.4.2.min.js new file mode 100644 index 0000000..f1655d4 --- /dev/null +++ b/min/perfect-scrollbar-0.4.2.min.js @@ -0,0 +1,4 @@ +/*! perfect-scrollbar - v0.4.2 +* http://noraesae.github.com/perfect-scrollbar/ +* Copyright (c) 2013 HyeonJe Jun; Licensed MIT */ +(function(e){var t={wheelSpeed:10,wheelPropagation:!1,minScrollbarLength:null};e.fn.perfectScrollbar=function(o,r){return this.each(function(){var n=e.extend(!0,{},t);if("object"==typeof o?e.extend(!0,n,o):r=o,"update"===r)return e(this).data("perfect-scrollbar-update")&&e(this).data("perfect-scrollbar-update")(),e(this);if("destroy"===r)return e(this).data("perfect-scrollbar-destroy")&&e(this).data("perfect-scrollbar-destroy")(),e(this);if(e(this).data("perfect-scrollbar"))return e(this).data("perfect-scrollbar");var l,s,c,a,i,p,f,u,d=e(this).addClass("ps-container"),h=e("").appendTo(d),g=e("").appendTo(d),v=parseInt(h.css("bottom"),10),b=parseInt(g.css("right"),10),m=function(){var e=parseInt(u*(a-s)/(s-f),10);d.scrollTop(e),h.css({bottom:v-e})},w=function(){var e=parseInt(p*(c-l)/(l-i),10);d.scrollLeft(e),g.css({right:b-e})},T=function(e){return n.minScrollbarLength&&(e=Math.max(e,n.minScrollbarLength)),e},L=function(){h.css({left:p+d.scrollLeft(),bottom:v-d.scrollTop(),width:i}),g.css({top:u+d.scrollTop(),right:b-d.scrollLeft(),height:f})},C=function(){l=d.width(),s=d.height(),c=d.prop("scrollWidth"),a=d.prop("scrollHeight"),c>l?(i=T(parseInt(l*l/c,10)),p=parseInt(d.scrollLeft()*(l-i)/(c-l),10)):(i=0,p=0,d.scrollLeft(0)),a>s?(f=T(parseInt(s*s/a,10)),u=parseInt(d.scrollTop()*(s-f)/(a-s),10)):(f=0,u=0,d.scrollTop(0)),u>=s-f&&(u=s-f),p>=l-i&&(p=l-i),L()},I=function(e,t){var o=e+t,r=l-i;p=0>o?0:o>r?r:o,h.css({left:p+d.scrollLeft()})},y=function(e,t){var o=e+t,r=s-f;u=0>o?0:o>r?r:o,g.css({top:u+d.scrollTop()})},D=function(){var t,o;h.bind("mousedown.perfect-scroll",function(e){o=e.pageX,t=h.position().left,h.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){h.hasClass("in-scrolling")&&(w(),I(t,e.pageX-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){h.hasClass("in-scrolling")&&h.removeClass("in-scrolling")})},P=function(){var t,o;g.bind("mousedown.perfect-scroll",function(e){o=e.pageY,t=g.position().top,g.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){g.hasClass("in-scrolling")&&(m(),y(t,e.pageY-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){g.hasClass("in-scrolling")&&g.removeClass("in-scrolling")})},x=function(){var e=function(e,t){var o=d.scrollTop();if(0===o&&t>0&&0===e)return!n.wheelPropagation;if(o>=a-s&&0>t&&0===e)return!n.wheelPropagation;var r=d.scrollLeft();return 0===r&&0>e&&0===t?!n.wheelPropagation:r>=c-l&&e>0&&0===t?!n.wheelPropagation:!0};d.bind("mousewheel.perfect-scroll",function(t,o,r,l){d.scrollTop(d.scrollTop()-l*n.wheelSpeed),d.scrollLeft(d.scrollLeft()+r*n.wheelSpeed),C(),e(r,l)&&t.preventDefault()})},X=function(){var t=function(e,t){d.scrollTop(d.scrollTop()-t),d.scrollLeft(d.scrollLeft()-e),C()},o={},r=0,n={},l=null,s=!1;e(window).bind("touchstart.perfect-scroll",function(){s=!0}),e(window).bind("touchend.perfect-scroll",function(){s=!1}),d.bind("touchstart.perfect-scroll",function(e){var t=e.originalEvent.targetTouches[0];o.pageX=t.pageX,o.pageY=t.pageY,r=(new Date).getTime(),null!==l&&clearInterval(l),e.stopPropagation()}),d.bind("touchmove.perfect-scroll",function(e){if(!s&&1===e.originalEvent.targetTouches.length){var l=e.originalEvent.targetTouches[0],c={};c.pageX=l.pageX,c.pageY=l.pageY;var a=c.pageX-o.pageX,i=c.pageY-o.pageY;t(a,i),o=c;var p=(new Date).getTime();n.x=a/(p-r),n.y=i/(p-r),r=p,e.preventDefault()}}),d.bind("touchend.perfect-scroll",function(){l=setInterval(function(){return.01>Math.abs(n.x)&&.01>Math.abs(n.y)?(clearInterval(l),void 0):(t(30*n.x,30*n.y),n.x*=.8,n.y*=.8,void 0)},10)})},Y=function(){h.remove(),g.remove(),d.unbind(".perfect-scroll"),e(window).unbind(".perfect-scroll"),d.data("perfect-scrollbar",null),d.data("perfect-scrollbar-update",null),d.data("perfect-scrollbar-destroy",null)},S=function(t){d.addClass("ie").addClass("ie"+t);var o=function(){var t=function(){e(this).addClass("hover")},o=function(){e(this).removeClass("hover")};d.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),h.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),g.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o)},r=function(){L=function(){h.css({left:p+d.scrollLeft(),bottom:v,width:i}),g.css({top:u+d.scrollTop(),right:b,height:f}),h.hide().show(),g.hide().show()},m=function(){var e=parseInt(u*a/s,10);d.scrollTop(e),h.css({bottom:v}),h.hide().show()},w=function(){var e=parseInt(p*c/l,10);d.scrollLeft(e),g.hide().show()}};6===t&&(o(),r())},E="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,M=function(){var e=navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);e&&"msie"===e[1]&&S(parseInt(e[2],10)),C(),D(),P(),E&&X(),d.mousewheel&&x(),d.data("perfect-scrollbar",d),d.data("perfect-scrollbar-update",C),d.data("perfect-scrollbar-destroy",Y)};return M(),d})}})(jQuery); \ No newline at end of file diff --git a/min/perfect-scrollbar-0.4.2.with-mousewheel.min.js b/min/perfect-scrollbar-0.4.2.with-mousewheel.min.js new file mode 100644 index 0000000..3ef2a5c --- /dev/null +++ b/min/perfect-scrollbar-0.4.2.with-mousewheel.min.js @@ -0,0 +1,4 @@ +/*! perfect-scrollbar - v0.4.2 +* http://noraesae.github.com/perfect-scrollbar/ +* Copyright (c) 2013 HyeonJe Jun; Licensed MIT */ +(function(e){var t={wheelSpeed:10,wheelPropagation:!1,minScrollbarLength:null};e.fn.perfectScrollbar=function(o,r){return this.each(function(){var n=e.extend(!0,{},t);if("object"==typeof o?e.extend(!0,n,o):r=o,"update"===r)return e(this).data("perfect-scrollbar-update")&&e(this).data("perfect-scrollbar-update")(),e(this);if("destroy"===r)return e(this).data("perfect-scrollbar-destroy")&&e(this).data("perfect-scrollbar-destroy")(),e(this);if(e(this).data("perfect-scrollbar"))return e(this).data("perfect-scrollbar");var l,s,a,c,i,p,u,f,d=e(this).addClass("ps-container"),h=e("").appendTo(d),v=e("").appendTo(d),g=parseInt(h.css("bottom"),10),m=parseInt(v.css("right"),10),b=function(){var e=parseInt(f*(c-s)/(s-u),10);d.scrollTop(e),h.css({bottom:g-e})},w=function(){var e=parseInt(p*(a-l)/(l-i),10);d.scrollLeft(e),v.css({right:m-e})},T=function(e){return n.minScrollbarLength&&(e=Math.max(e,n.minScrollbarLength)),e},L=function(){h.css({left:p+d.scrollLeft(),bottom:g-d.scrollTop(),width:i}),v.css({top:f+d.scrollTop(),right:m-d.scrollLeft(),height:u})},I=function(){l=d.width(),s=d.height(),a=d.prop("scrollWidth"),c=d.prop("scrollHeight"),a>l?(i=T(parseInt(l*l/a,10)),p=parseInt(d.scrollLeft()*(l-i)/(a-l),10)):(i=0,p=0,d.scrollLeft(0)),c>s?(u=T(parseInt(s*s/c,10)),f=parseInt(d.scrollTop()*(s-u)/(c-s),10)):(u=0,f=0,d.scrollTop(0)),f>=s-u&&(f=s-u),p>=l-i&&(p=l-i),L()},C=function(e,t){var o=e+t,r=l-i;p=0>o?0:o>r?r:o,h.css({left:p+d.scrollLeft()})},y=function(e,t){var o=e+t,r=s-u;f=0>o?0:o>r?r:o,v.css({top:f+d.scrollTop()})},D=function(){var t,o;h.bind("mousedown.perfect-scroll",function(e){o=e.pageX,t=h.position().left,h.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){h.hasClass("in-scrolling")&&(w(),C(t,e.pageX-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){h.hasClass("in-scrolling")&&h.removeClass("in-scrolling")})},x=function(){var t,o;v.bind("mousedown.perfect-scroll",function(e){o=e.pageY,t=v.position().top,v.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){v.hasClass("in-scrolling")&&(b(),y(t,e.pageY-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){v.hasClass("in-scrolling")&&v.removeClass("in-scrolling")})},P=function(){var e=function(e,t){var o=d.scrollTop();if(0===o&&t>0&&0===e)return!n.wheelPropagation;if(o>=c-s&&0>t&&0===e)return!n.wheelPropagation;var r=d.scrollLeft();return 0===r&&0>e&&0===t?!n.wheelPropagation:r>=a-l&&e>0&&0===t?!n.wheelPropagation:!0};d.bind("mousewheel.perfect-scroll",function(t,o,r,l){d.scrollTop(d.scrollTop()-l*n.wheelSpeed),d.scrollLeft(d.scrollLeft()+r*n.wheelSpeed),I(),e(r,l)&&t.preventDefault()})},X=function(){var t=function(e,t){d.scrollTop(d.scrollTop()-t),d.scrollLeft(d.scrollLeft()-e),I()},o={},r=0,n={},l=null,s=!1;e(window).bind("touchstart.perfect-scroll",function(){s=!0}),e(window).bind("touchend.perfect-scroll",function(){s=!1}),d.bind("touchstart.perfect-scroll",function(e){var t=e.originalEvent.targetTouches[0];o.pageX=t.pageX,o.pageY=t.pageY,r=(new Date).getTime(),null!==l&&clearInterval(l),e.stopPropagation()}),d.bind("touchmove.perfect-scroll",function(e){if(!s&&1===e.originalEvent.targetTouches.length){var l=e.originalEvent.targetTouches[0],a={};a.pageX=l.pageX,a.pageY=l.pageY;var c=a.pageX-o.pageX,i=a.pageY-o.pageY;t(c,i),o=a;var p=(new Date).getTime();n.x=c/(p-r),n.y=i/(p-r),r=p,e.preventDefault()}}),d.bind("touchend.perfect-scroll",function(){l=setInterval(function(){return.01>Math.abs(n.x)&&.01>Math.abs(n.y)?(clearInterval(l),void 0):(t(30*n.x,30*n.y),n.x*=.8,n.y*=.8,void 0)},10)})},Y=function(){h.remove(),v.remove(),d.unbind(".perfect-scroll"),e(window).unbind(".perfect-scroll"),d.data("perfect-scrollbar",null),d.data("perfect-scrollbar-update",null),d.data("perfect-scrollbar-destroy",null)},S=function(t){d.addClass("ie").addClass("ie"+t);var o=function(){var t=function(){e(this).addClass("hover")},o=function(){e(this).removeClass("hover")};d.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),h.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),v.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o)},r=function(){L=function(){h.css({left:p+d.scrollLeft(),bottom:g,width:i}),v.css({top:f+d.scrollTop(),right:m,height:u}),h.hide().show(),v.hide().show()},b=function(){var e=parseInt(f*c/s,10);d.scrollTop(e),h.css({bottom:g}),h.hide().show()},w=function(){var e=parseInt(p*a/l,10);d.scrollLeft(e),v.hide().show()}};6===t&&(o(),r())},E="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,M=function(){var e=navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);e&&"msie"===e[1]&&S(parseInt(e[2],10)),I(),D(),x(),E&&X(),d.mousewheel&&P(),d.data("perfect-scrollbar",d),d.data("perfect-scrollbar-update",I),d.data("perfect-scrollbar-destroy",Y)};return M(),d})}})(jQuery),function(e){function t(t){var o=t||window.event,r=[].slice.call(arguments,1),n=0,l=0,s=0;return t=e.event.fix(o),t.type="mousewheel",o.wheelDelta&&(n=o.wheelDelta/120),o.detail&&(n=-o.detail/3),s=n,void 0!==o.axis&&o.axis===o.HORIZONTAL_AXIS&&(s=0,l=-1*n),void 0!==o.wheelDeltaY&&(s=o.wheelDeltaY/120),void 0!==o.wheelDeltaX&&(l=-1*o.wheelDeltaX/120),r.unshift(t,n,l,s),(e.event.dispatch||e.event.handle).apply(this,r)}var o=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var r=o.length;r;)e.event.fixHooks[o[--r]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=o.length;e;)this.addEventListener(o[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=o.length;e;)this.removeEventListener(o[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery); \ No newline at end of file diff --git a/package.json b/package.json index 9748513..422cdd1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "perfect-scrollbar", - "version": "0.4.1", + "version": "0.4.2", "engines": { "node": ">= 0.8.0" }, diff --git a/perfect-scrollbar.jquery.json b/perfect-scrollbar.jquery.json index 377148d..dc28028 100644 --- a/perfect-scrollbar.jquery.json +++ b/perfect-scrollbar.jquery.json @@ -2,7 +2,7 @@ "name": "perfect-scrollbar", "title": "perfect-scrollbar", "description": "Tiny but perfect jquery scrollbar plugin.", - "version": "0.4.1", + "version": "0.4.2", "author": { "name": "HyeonJe Jun", "email": "noraesae@yuiazu.net",