Skip to content

Instantly share code, notes, and snippets.

@xandout
Last active February 23, 2021 16:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xandout/9532ef97be22f7557483 to your computer and use it in GitHub Desktop.
Save xandout/9532ef97be22f7557483 to your computer and use it in GitHub Desktop.
Enable horizontal scrolling on Trello boards
//To create a bookmarklet just append javascript: to this code and set as the URL in a new bookmark
var el = document.getElementById('board');
el.className += " trello-scroll";
document.addEventListener("wheel", function(e){
var under = document.elementFromPoint(e.clientX, e.clientY);
if(hasClass(under, "list-wrapper") || hasClass(under, "trello-scroll")){
if((e.wheelDelta>0?"left":"right") == "right"){
el.scrollLeft += 10;
} else {
el.scrollLeft -= 10;
};
};
});
function hasClass(el, cls) {
return el.className && new RegExp("(\\s|^)" + cls + "(\\s|$)").test(el.className);
};
@tyrannosaurusjames
Copy link

Alternatively you can just hold down shift and scroll...

@xandout
Copy link
Author

xandout commented Dec 16, 2015

Thanks @GUTTMANN!! Brain fart made me write code.

@bentalgad
Copy link

How do i install it. i really need this. can you make a chrome extention?

@Lathryx
Copy link

Lathryx commented Feb 23, 2021

How do i install it. i really need this. can you make a chrome extention?

To use a script like this, install a browser extension like Tampermonkey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment