jquery - offset().top doesnt count the height of chrome extention toolbar -
i trying offset top of element, appears if there kind of gooogle chrome extention toolbar - loads after page loaded in iframe , height not counted in offset().top.
i running jquery function on (window).load(), maybe not correct?
it's noticed happening. might best practice make calculations in window's onresize event:
$(window).load(function() { $(window).trigger('resize'); }); $(window).resize(function() { // offset().top; calculation here, when window loads , each time window resized. });
also, post full example of code (css, html, js) in jsfiddle. have hunch .position() work better .offset(), possibly minor css/html tweaks but, can't tell without seeing code.
Comments
Post a Comment