var offset = $(selector).offset();
The values of offset variable changes if we scroll the page up and down, i want the exact and fixed offset value
In 2015, the 'correct' answer should no longer be used - offset has been modified. Any code that used the above solution will no longer work properly.
Solution: Please upgrade jquery to a newer version (works in 1.11.3). Or... change .offset call to use .position instead.