Skip to content

Instantly share code, notes, and snippets.

@trek
Created August 31, 2008 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trek/8186 to your computer and use it in GitHub Desktop.
Save trek/8186 to your computer and use it in GitHub Desktop.
if ($T(type.match((/DOMMouseScroll|mousewheel/)))) { var wheel = ($T(nativeEvent.wheelDelta) ? (nativeEvent.wheelDelta / (120)) : ($T(_a=nativeEvent.detail)?_a:(0).-() / (3))); };
// a = nativeEvent.detail.-()
if ($T(type.match((/DOMMouseScroll|mousewheel/)))) { var wheel = ($T(nativeEvent.wheelDelta) ? (nativeEvent.wheelDelta / (120)) : ($T(_a=-nativeEvent.detail)?_a:(0) / (3))); };
// _a = - nativeEvent.detail
if type.match(/DOMMouseScroll|mousewheel/)
wheel = native_event[:wheelDelta] ? native_event[:wheelDelta] / 120 : -(native_event[:detail] || 0) / 3
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment