javascript - Document position of an element in an iframe -
i have javascript code uses obj.offsetleft , obj.offsettop image position, hovers element @ location. however, long story short, ive had embed html inside iframe sits inside main page. in ie7, hover element appears in correct location fine, until user scrolls page. page scrolled downwards, hovered element seems move downwards also, losing sync real position.
i tried using while loop cycle through offsetparent, adding offsets. seems high iframe.
is there other way accurately retrieve position of element inside iframe, relative entire page?
and can't use css positions achieve that? otherwise, have calculate iframe position , add positions calculated inside iframe position "document wise"
Comments
Post a Comment