Skip to content

Instantly share code, notes, and snippets.

@loominade
Created April 1, 2015 08:02
Show Gist options
  • Save loominade/4082e9166739e8a25ab5 to your computer and use it in GitHub Desktop.
Save loominade/4082e9166739e8a25ab5 to your computer and use it in GitHub Desktop.
ever bothered there is a scrollLeft() but no scrollRight() function in jQuery?
$.fn.extend({
scrollRight: function(property) {
return this[0].scrollWidth - (this[0].scrollLeft + this[0].clientWidth) + 1;
}
});
@loominade
Copy link
Author

I just had the same problem and found this post from myself 5 years ago. Thanks me five years ago.

@avitalar
Copy link

avitalar commented Mar 3, 2020

lol loominade
Thank you indeed

@Duspy99
Copy link

Duspy99 commented Mar 26, 2020

Man ty!

@Tovape
Copy link

Tovape commented Sep 6, 2023

this should be on the next version of ecma

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