How can I possibly figure out the distance from an object (div) to the right browser window border?
http://www.screencast.com/t/ryNgwa4E
Thanks!
$(window).width() - ($('#your-element').offset().left + $('#your-element').width());
That takes the width of your element adds it to the position of the element within the document and takes it away from the whole window size which should leave you with the right hand distance between element and window.