Example 1:
- Formula One Teams (2018)
- ○ Scuderia Ferrari
- ○ Sahara Force India F1 Team
- ○ Haas F1 Team
- ○ McLaren F1 Team
- ○ Mercedes AMG Petronas Motorsport
- ○ Aston Martin Red Bull Racing
- ○ Renault Sport Formula One Team
- ○ Alfa Romeo Sauber F1 Team
- ○ Red Bull Toro Rosso Honda
- ○ Williams Martini Racing
Example 2:
- Formula One Drivers (2018)
- ● Lewis Hamilton
- ● Sebastian Vettel
- ● Kimi Räikkönen
- ● Valtteri Bottas
- ● Daniel Ricciardo
- ● Max Verstappen
- ● Nico Hülkenberg
- ● Kevin Magnussen
- ● Fernando Alonso
- ● Sergio Pérez
- ● Carlos Sainz Jr.
- ● Esteban Ocon
- ● Pierre Gasly
- ● Romain Grosjean
- ● Charles Leclerc
- ● Stoffel Vandoorne
- ● Marcus Ericsson
- ● Lance Stroll
- ● Brendon Hartley
- ● Sergey Sirotkin
Example 3:
- Formula One combined (2018)
- Scuderia Ferrari
- ● Sebastian Vettel
- ● Kimi Räikkönen
- Mercedes AMG
- ● Lewis Hamilton
- ● Valtteri Bottas
- Haas F1 Team
- ● Romain Grosjean
- ● Kevin Magnussen
- McLaren F1 Team
- ● Fernando Alonso
- ● Stoffel Vandoorne
- Red Bull Racing
- ● Max Verstappen
- ● Daniel Ricciardo
- Renault
- ● Max Verstappen
- ● Daniel Ricciardo
- Scuderia Ferrari
jslists is a small JavaScript library that can turn those pesky unordered & ordered list into a funky tree.
There is an example to the left which demostrates the basic functionality
Because JSLists doesn't effect any element of the HTML list you are passing is, you can use all of the functionality of standard HTML list. So ALL list items can contain any valid HTML elements, such as anchors <a>, <img>, <div> etc. It's pretty easy to use. To create a tree element, give the UL/OL an id, then simply add another unordered or ordered list as a list item. The text within the list item becomes the heading for that list.
The markup for the Formula One Teams list to the left is:
<ul id='f1teams' class='jslists'>
<li>Formula One Teams (2018)
<ul>
<li>○ Scuderia Ferrari</li>
<li>○ Sahara Force India F1 Team</li>
<li>○ Haas F1 Team</li>
<li>○ McLaren F1 Team</li>
<li>○ Mercedes AMG Petronas Motorsport</li>
<li>○ Aston Martin Red Bull Racing</li>
<li>○ Renault Sport Formula One Team</li>
<li>○ Alfa Romeo Sauber F1 Team</li>
<li>○ Red Bull Toro Rosso Honda</li>
<li>○ Williams Martini Racing</li>
</ul>
</li>
</ul>
You can also create nested lists using jsLists. Check out the source code for Example 3 and you will see the pattern is the same as the standard list.
Because JSLists doesn't effect any element of the HTML list you are passing is, you can use all of the functionality of standard HTML list. So ALL list items can contain any valid HTML elements, such as anchors <a>, <img>, <div> etc. It's pretty easy to use. To create a tree element, give the UL/OL an id, then simply add another unordered or ordered list as a list item. The text within the list item becomes the heading for that list.
The markup for the Formula One Teams list to the left is:
<ul id='f1teams' class='jslists'>
<li>Formula One Teams (2018)
<ul>
<li>○ Scuderia Ferrari</li>
<li>○ Sahara Force India F1 Team</li>
<li>○ Haas F1 Team</li>
<li>○ McLaren F1 Team</li>
<li>○ Mercedes AMG Petronas Motorsport</li>
<li>○ Aston Martin Red Bull Racing</li>
<li>○ Renault Sport Formula One Team</li>
<li>○ Alfa Romeo Sauber F1 Team</li>
<li>○ Red Bull Toro Rosso Honda</li>
<li>○ Williams Martini Racing</li>
</ul>
</li>
</ul>
You can also create nested lists using jsLists. Check out the source code for Example 3 and you will see the pattern is the same as the standard list.