javascript - offsetTop vs. jQuery.offset().top -
i have read offsetleft , offsettop not work in browsers. jquery.offset() supposed provide abstraction provide correct value xbrowser.
what trying coordinates of element clicked relative top-left of element.
problem jquery.offset().top giving me decimal value in ffx 3.6 (in ie , chrome, 2 values match).
http://jsfiddle.net/htcpp/ exhibits issue. if click bottom image, jquery.offset().top returns 327.5, offsettop returns 328.
i think offset() returning correct value , should use because work across browsers. however, people cannot click decimals of pixels. proper way determine true offset math.round() offset jquery returning? should use offsettop instead, or other method entirely?
i think right saying people cannot click half pixels, personally, use rounded jquery offset...
Comments
Post a Comment