jQuery: The Write Less, Do More JavaScript Library

 « Return to Thread: Get dynamic width

Re: Get dynamic width

by Liam Potter :: Rate this Message:

Reply to Author | View in Thread


why not find the width of the div?

$("div#scroller").width();

eewan wrote:

> Hello,
> I want to find full width of all elements in one div. Here is example
> code:
> <div id="scroller">
> <p>text</p>
> <p>text</p>
> <p>text</p>
> <p>text</p>
> </div>
>
>
> $("#scroller p").each(
> function(i){
> var elSize = $(this).width();});
>
> I need total width of all <p> :-)
>
> Thanks in advance
>  

 « Return to Thread: Get dynamic width