Detect Scroll Direction & Position In jQuery
A tiny jQuery plugin that detects scroll direction (up & down) and scroll position and adds CSS classes to specific indicator elements accordingly.
Demo
Download





#sam reid#interview with the vampire#the vampire lestat#iwtv
seen from Finland

seen from United States
seen from South Korea

seen from Brazil

seen from United States
seen from Switzerland

seen from Switzerland

seen from Japan
seen from Switzerland
seen from Switzerland
seen from Switzerland
seen from Bolivia
seen from Switzerland
seen from Finland
seen from Russia

seen from United States
seen from China
seen from Russia
seen from Switzerland
seen from South Korea
Detect Scroll Direction & Position In jQuery
A tiny jQuery plugin that detects scroll direction (up & down) and scroll position and adds CSS classes to specific indicator elements accordingly.
Demo
Download

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Javascript Get Scroll/Wheel Direction
document window has a “wheel” event. Nothing beats the practice of exploring the browser console to see what information is readily available.
console logging the wheel event returns a lot of useful info, including direction via deltaY. This number either increases positively or decreases negatively.
The code:
Add event listener (do something special for Internet Explorer because it’s special)
if(window.addEventListener){ addEventListener('wheel', whichDirection, false); } else if (window.attachEvent) { // ie attachEvent('wheel', whichDirection, false); }
Create function (naming the parameter ‘event’ is good practice offering clarity)
function whichDirection(event){ console.log(event + ' WheelEvent has all kinds of good stuff to work with'); var scrollDirection = event.deltaY; if(scrollDirection === 1){ console.log('meet me at the club, going down’, scrollDirection); } else if(scrollDirection === -1) { console.log('Going up, on a tuesday’, scrollDirection); } }
Using jQuery (the function remains the same)
$(window).on('wheel', function(){ whichDirection(event); });
Throttle / Debounce:
Watch this in the console, you’ll see the WheelEvent firing over and over. Check out David Walsh’s article on creating a Debounce Function. You’ll be up and running with some hotness in short order.
Response Given to Stack Overflow Question here
How To Fix Your OSX
How to change the scroll direction - activate tab click and hide and show the dock in Yosemite:
How to change all your multitouch gestures in OS X:
How to activate window snap on your mac:
How to ungroup mission control in OS X Yosemite:
How to show your hard disk on the desktop:
How to activate snap to grid on desktop and how to change the icon size:
How to disable the account name in the finderbar:
How to activate dashboard overlay in OS X:
How to disable automatic autocorrection:
How to disable program autostart on startup:
How the new power button works in OSX Yosemite:
How to change the settings of your finder favourites:
How to show the scrollbar, path bar, status bar and change the size of items in the finder:
How to change icons in OS X Yosemite:
How to activate cut and paste + colorful finder icons: