Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Building on <a href="https://stackoverflow.com/a/15480307/1430996">Vitaliy's CSS</a> and <a href="https://stackoverflow.com/a/16664260/1430996">Mehmet's jQuery</a>, I changed the <code>a</code> tags to <code>span</code> tags and incorporated some <a href="http://getbootstrap.com/2.3.2/base-css.html#icons" rel="noreferrer">Glyphicons</a> and <a href="http://getbootstrap.com/2.3.2/components.html#labels-badges" rel="noreferrer">badging</a> into <a href="http://jsfiddle.net/jhfrench/GpdgF/" rel="noreferrer">my take on a Bootstrap tree widget</a>.</p> <p><strong>Example:</strong> <img src="https://i.stack.imgur.com/qnp0a.png" alt="my take on a Bootstrap tree widget"></p> <p>For extra credit, I've created a <img src="https://i.stack.imgur.com/wG64V.png" alt="Github icon"><a href="https://github.com/jhfrench/bootstrap-tree" rel="noreferrer">GitHub project to host the jQuery and LESS code that goes into adding this tree component</a> to Bootstrap. Please see the project documentation at <a href="http://jhfrench.github.io/bootstrap-tree/docs/example.html" rel="noreferrer">http://jhfrench.github.io/bootstrap-tree/docs/example.html</a>.</p> <p>Alternately, here is the LESS source to generate that CSS (the JS can be picked up from the <a href="http://jsfiddle.net/jhfrench/GpdgF/" rel="noreferrer">jsFiddle</a>):</p> <pre><code>@import "../../../external/bootstrap/less/bootstrap.less"; /* substitute your path to the bootstrap.less file */ @import "../../../external/bootstrap/less/responsive.less"; /* optional; substitute your path to the responsive.less file */ /* collapsable tree */ .tree { .border-radius(@baseBorderRadius); .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); background-color: lighten(@grayLighter, 5%); border: 1px solid @grayLight; margin-bottom: 10px; max-height: 300px; min-height: 20px; overflow-y: auto; padding: 19px; a { display: block; overflow: hidden; text-overflow: ellipsis; width: 90%; } li { list-style-type: none; margin: 0px 0; padding: 4px 0px 0px 2px; position: relative; &amp;::before, &amp;::after { content: ''; left: -20px; position: absolute; right: auto; } &amp;::before { border-left: 1px solid @grayLight; bottom: 50px; height: 100%; top: 0; width: 1px; } &amp;::after { border-top: 1px solid @grayLight; height: 20px; top: 13px; width: 23px; } span { -moz-border-radius: 5px; -webkit-border-radius: 5px; border: 1px solid @grayLight; border-radius: 5px; display: inline-block; line-height: 14px; padding: 2px 4px; text-decoration: none; } &amp;.parent_li &gt; span { cursor: pointer; /*Time for some hover effects*/ &amp;:hover, &amp;:hover+ul li span { background: @grayLighter; border: 1px solid @gray; color: #000; } } /*Remove connectors after last child*/ &amp;:last-child::before { height: 30px; } } /*Remove connectors before root*/ &gt; ul &gt; li::before, &gt; ul &gt; li::after { border: 0; } } </code></pre>
    singulars
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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