How the total light width is calculated and the width of the parent div is determined.
My example code:
& lt; Ul & gt; & Lt; Li & gt; Dsfdsfdsfds & lt; / Li & gt; & Lt; Li & gt; Dsfdsfdsfds & lt; / Li & gt; & Lt; Li & gt; Dsfdsfdsfds & lt; / Li & gt; & Lt; Li & gt; Dsfdsfdsfds & lt; / Li & gt; & Lt; Li & gt; Dsfdsfdsfds & lt; / Li & gt; & Lt; Li & gt; Dsfdsfdsfds & lt; / Li & gt; & Lt; / Ul & gt;
CSS style:
ul li {width: 400px; Float: left;}
Use this code
& lt; Script type = "text / javascript" src = "public / js / jquery -1.4.2min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ('. Nested_li ul'). Each (function () {var liItems = $ (this); var sum = 0; if (liItems.children ('li'). Length (gt; = 1) {$ (this). Child ('li'). Each (function (i, e) {tot + = $ (e). Upright (true);}); $ (this) Wide (Yoga + 1);}})}}; & lt; / script & gt;
No comments:
Post a Comment