jQuery.fn.extend({
'offsetBottom' : function() {
var d = $( document ), t = $( this );
return d.height() - t.offset().top - t.height()
},
'offsetRight' : function() {
var d = $( document ), t = $( this );
return d.width() - t.offset().left - t.width()
}
})
$( some-element ).offsetBottom().offsetRight()
var body = document.body, html = document.documentElement;
var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );