I'm trying to get the position of an element within the window like so:
var link = $(element);
var offset = link.offset();
var top = offset.top;
var left = offset.left;
var bottom = $(window).height() - link.height();
bottom = offset.top - bottom;
var right = $(window).width() - link.width();
right = offset.left - right;
However the bottom and right have -
in front of them... Why is this? as the numbers are correct just they should NOT be minus.