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
You could always calculate the offset, factoring in the scroll position:
var offset_t = $(selector).offset().top - $(window).scrollTop(); var offset_l = $(selector).offset().left - $(window).scrollLeft();