9blue
9blue

Reputation: 4753

jQuery: how to get proper scrollRight value?

I have a function which relies on the value of scrollLeft. Now, I need have this function work in right to left direction( arabic ), so I need to figure out how to get the proper scrollRight value. Can someone enlighten me?

Upvotes: 0

Views: 1361

Answers (1)

DLeh
DLeh

Reputation: 24395

Find the width of the page and subtract it from scrollLeft()'s value.

var left = $('html').scrollLeft();
var screenSize = 1024; //find width of screen / viewport. google.
var right = screensize - left;

Upvotes: 1

Related Questions