Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to find the width of hidden content in order to resize the containing div to show the content (jQuery)
    primarykey
    data
    text
    <p>I am trying to create a resizing container that will "grow" on $('element').hover, but I only want to do so when the content in the LI is to wide and hidden due to a css overlow:hidden. I can't seem to find a way to find the total widht of the hidden content. For example:</p> <pre><code>&lt;ul id="innerContainer"&gt; &lt;li&gt;&lt;a href="/Afrikaans/index.html"&gt;Afrikaans&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/Arabic/index.html"&gt;Arabic&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/Chinese/index.html"&gt;Chinese (Mandarin) What The Its Just Crazy&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>The li containing the Chinese (Mandarin)... is too wide to fit in the 172px wide container. I want to be able to find out the width on .hover() so I can resize the container to fit. I need it to be dynamic because the li that is too wide will not always conatin the same content. CSS is :</p> <pre><code>#innerContainer {position:absolute; left:0; top:0; height:200px; overflow:hidden;} #scroller ul {margin:0; padding:0; list-style:none;width:172px;} #scroller ul li {float:left; height:27px; width:172px;} #scroller ul li a {overflow:hidden;display:block; float:left; height:26px; line-height:26px; width:172px; font-size:11px; color:#000; font-weight:bold; text-decoration:none; text-indent:5px; border-bottom:1px solid #000;} </code></pre> <p>All i can get is the actual width which is 172px.</p> <p>Take into consideration that the items are already in a vertically scrollable container. An example of this in action is at <a href="http://www.pronunciator.com/Vietnamese/index.html" rel="nofollow">http://www.pronunciator.com/Vietnamese/index.html</a> You can see how the rows in the menu that are too wide overflow into the next line. I killed that by using overflow:hidden. Now i need to find the width of the line of hidden text.</p> <p>Thanks in advance for any replies.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload