Skip to content

Instantly share code, notes, and snippets.

Avatar

Saeid Mohadjer smohadjer

View GitHub Profile
@smohadjer
smohadjer / scrollByPixel.md
Last active Apr 29, 2016
scroll by pixel using arrow keys
View scrollByPixel.md

Scroll by one pixel via arrow keys up/down for finer control over scrolling. Use to debug scroll related issues.

$(window).on('keydown', function(event) {
	event.preventDefault();
	event.stopPropagation();
	
	var sctop = $(window).scrollTop();
	
	if (event.keyCode === 38) { //up arrow
You can’t perform that action at this time.