Javascript/jQuery get true width and position of float affected element? -


is possible width (using javascript or jquery) of float-affected element? when text being pushed on due floating image possible position , true width? have attached image explain better.

code example,

<div>     <img style="...float: left"/>     <h1>a title!</h1>     <p>text!</p>     <h1>new header added.</h1> </div> 

picture

i need find width starting arrow, (the gray box image)(the dotted line width according firefox inspect mode).

i avoid changing elements display types if possible. thank you!

first of all, "full width" true width.

you can watch picture, can understand why true width , true position of affected element way firefox tells you.

http://i.stack.imgur.com/mb5ds.png

to width of inline text it's pushed right float image, there's no way except using full width minus float image's width.

var w = $('p').width()          - $('img').width()          - $('img').css('margin-left').replace("px", "")         - $('img').css('margin-right').replace("px", "")         - $('img').css('padding-left').replace("px", "")         - $('img').css('padding-right').replace("px", "")         - $('img').css('border-left-width').replace("px", "")         - $('img').css('border-right-width').replace("px", ""); 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -