Skip to content

Instantly share code, notes, and snippets.

@shlomohass
shlomohass / jQuery-mousewheel-direction-capture.js
Last active October 28, 2022 20:24
jQuery - Get mousewheel scroll event to detect scrolling direction cross browser
$('body').on('mousewheel DOMMouseScroll', function(e){
if(typeof e.originalEvent.detail == 'number' && e.originalEvent.detail !== 0) {
if(e.originalEvent.detail > 0) {
console.log('Down');
} else if(e.originalEvent.detail < 0){
console.log('Up');
}
} else if (typeof e.originalEvent.wheelDelta == 'number') {
if(e.originalEvent.wheelDelta < 0) {
console.log('Down');
@RhinoLu
RhinoLu / gist:2835372
Created May 30, 2012 10:30
AS3 Captcha
/*
VERSION: 1.0 DATE:2009/11/20
ACTIONSCRIPT VERSION: 3.0
AUTHOR: DFdou, k5love@foxmail.com
Copyright 2009, nwhy.org. All rights reserved.
DESCRIPTION:
Captcha is a simple class to generate Caphtcha Sprite.
PARAMETERS: