Diff Revisions 76 vs 77 for /overscroll/jquery.overscroll.min.js
| 76 | 77 | <- Revisions | |
|
Diff lines for: Rev 76 : Lines 49 -> 52 Rev 77 : Lines 49 -> 52 |
|||
| 49 | 49 | * convenience (see below). | |
| 50 | 50 | * | |
| 51 | 51 | */ | |
| 52 | - | "use strict";(function(a,b){b=a.fn.overscroll=function(){this.each(b.init)};a.extend(b,{icons:{open:"http://static.azoffdesign.com/misc/open.cur",closed:"http://static.azoffdesign.com/misc/closed.cur"},init:function(d,e,c){d={};e=a(this).css({cursor:"url("+b.icons.open+"), default",overflow:"hidden"}).bind("mousewheel DOMMouseScroll",d,b.wheel).bind("select mousedown touchstart",d,b.start).bind("mouseup mouseleave touchend",d,b.stop).bind("ondragstart drag",function(){return false});d.target=e},wheel:function(c,d){if(c.wheelDelta){d=c.wheelDelta/12000}if(c.detail){d=-c.detail/3}c.data.target.stop(true,true).animate({scrollTop:this.scrollTop-(d*b.constants.wheelDeltaMod)},{queue:false,duration:b.constants.scrollDuration,easing:"cubicEaseOut"});return false},start:function(c){c.data.target.css("cursor","url("+b.icons.closed+"), default").bind("mousemove touchmove",c.data,b.drag).stop(true,true);c.data.position={x:c.pageX,y:c.pageY};c.data.capture={};c.data.isDragging=false;return false},drag:function(c){this.scrollLeft-=(c.pageX-c.data.position.x);this.scrollTop-=(c.pageY-c.data.position.y);c.data.position.x=c.pageX;c.data.position.y=c.pageY;if(typeof c.data.capture.index==="undefined"||--c.data.capture.index===0){c.data.isDragging=true;c.data.capture={x:c.pageX,y:c.pageY,index:b.constants.captureThreshold}}return true},stop:function(e){if(typeof e.data.position!=="undefined"){e.data.target.css("cursor","url("+b.icons.open+"), default").unbind("mousemove touchmove",b.drag);if(e.data.isDragging){var d=b.constants.scrollDeltaMod*(e.pageX-e.data.capture.x),c=b.constants.scrollDeltaMod*(e.pageY-e.data.capture.y);e.data.target.stop(true,true).animate({scrollLeft:this.scrollLeft-d,scrollTop:this.scrollTop-c},{queue:false,duration:b.constants.scrollDuration,easing:"cubicEaseOut"})}e.data.capture=e.data.position=undefined}return !e.data.isDragging},clickableRegExp:(/input|textarea|select|a/i),constants:{scrollDuration:800,captureThreshold:4,wheelDeltaMod:-200,scrollDeltaMod:4.7}});a.extend(a.easing,{cubicEaseOut:function(f,h,d,e){var g=d+e;return g*((f=f/1-1)*f*f+1)+d}})})(jQuery); | |
| 52 | + | "use strict";(function(a,b){b=a.fn.overscroll=function(){this.each(b.init)};a.extend(b,{icons:{open:"http://static.azoffdesign.com/misc/open.cur",closed:"http://static.azoffdesign.com/misc/closed.cur"},events:{wheel:"mousewheel DOMMouseScroll",start:"select mousedown touchstart",drag:"mousemove touchmove",end:"mouseup mouseleave touchend",ignored:"dragstart drag"},init:function(d,e,c){d={};e=a(this).css({cursor:"url("+b.icons.open+"), default",overflow:"hidden"}).bind(b.events.wheel,d,b.wheel).bind(b.events.start,d,b.start).bind(b.events.end,d,b.stop).bind(b.events.ignored,function(){return false});d.target=e},wheel:function(c,d){if(c.wheelDelta){d=c.wheelDelta/12000}if(c.detail){d=-c.detail/3}c.data.target.stop(true,true).animate({scrollTop:this.scrollTop-(d*b.constants.wheelDeltaMod)},{queue:false,duration:b.constants.scrollDuration,easing:"cubicEaseOut"});return false},start:function(c){c.data.target.css("cursor","url("+b.icons.closed+"), default").bind(b.events.drag,c.data,b.drag).stop(true,true);c.data.position={x:c.pageX,y:c.pageY};c.data.capture={};c.data.isDragging=false;return false},drag:function(c){this.scrollLeft-=(c.pageX-c.data.position.x);this.scrollTop-=(c.pageY-c.data.position.y);c.data.position.x=c.pageX;c.data.position.y=c.pageY;if(typeof c.data.capture.index==="undefined"||--c.data.capture.index===0){c.data.isDragging=true;c.data.capture={x:c.pageX,y:c.pageY,index:b.constants.captureThreshold}}return true},stop:function(e){if(typeof e.data.position!=="undefined"){e.data.target.css("cursor","url("+b.icons.open+"), default").unbind(b.events.drag,b.drag);if(e.data.isDragging){var d=b.constants.scrollDeltaMod*(e.pageX-e.data.capture.x),c=b.constants.scrollDeltaMod*(e.pageY-e.data.capture.y);e.data.target.stop(true,true).animate({scrollLeft:this.scrollLeft-d,scrollTop:this.scrollTop-c},{queue:false,duration:b.constants.scrollDuration,easing:"cubicEaseOut"})}e.data.capture=e.data.position=undefined}return !e.data.isDragging},clickableRegExp:(/input|textarea|select|a/i),constants:{scrollDuration:800,captureThreshold:4,wheelDeltaMod:-200,scrollDeltaMod:4.7}});a.extend(a.easing,{cubicEaseOut:function(f,h,d,e){var g=d+e;return g*((f=f/1-1)*f*f+1)+d}})})(jQuery); | |
View this file contents
View the full history
Commits for ad.dev:/overscroll/jquery.overscroll.min.js