Core Docs | Additional Modules Docs

sb.events.getWheelDirection


@Description: gets the mouse wheel delta e.g. the direction and amount it is being spun
@File: events/getWheelDirection.js
@Param: Object event An event reference as passed to a handler function as e
@Return: Number The wheel delta either 1 or -1 depending on the direction
@Example:
function printDelta(e){
    document.title = sb.events.getWheelDirection(e);
}

//firefox/safari/opera
sb.events.add('#box', 'DOMMouseScroll', printDelta);
//ie
sb.events.add('#box', 'mousewheel', printDelta);