JSFiddle - React, Tailwind, and code Playground

by jessikwa

HTML

<div class="msddlGroup">
    <dl class="msddl_selectItem"> 
        <dt>
            <a class="msddl_selectListToggle defaultSelected">
                <input class="selectorCatcher" type="text">
                <span class="msddl_selectedItems"></span>
            </a>
        </dt>
        <dd class="msddl_selectListFlyout">
            <div class="msddl_selectList">
                <ul>
                    <li>
                        <input type="checkbox" />
                        <label>
                            Nulla lectus metus, semper id libero quis, interdum efficitur quam
                        </label> 
                    </li>
                    <li>
                        <div>
                            <input type="checkbox" />
                        </div>
                        <div>
                            <label>
                                Nullam augue purus, aliquam vel odio at, fermentum pellentesque lectus
                            </label> 
                        </div>
                    </li>
                </ul>
            </div>
        </dd>
    </dl>
</div>

CSS

body {
    background: #eee;
}
/*msddl*/
.msddlGroup 
{
    display: block;
    float: left;
    margin: 0 0 0 1.6%;
    width: 32.26%; 
}
.msddlGroup:first-child {  
    margin-left: 0; 
}
@media only screen and (max-width: 480px) {
    .msddlGroup {  
        margin: -13px 0 0 0; 
        width: 100%; 
    }
    .msddlGroup:first-child { 
        margin-top: 0; 
    }
}
.msddl_selectItem dd {
    margin: 0px;
    padding: 0px;
}
.msddl_selectItem dt {
    cursor: pointer;
}
.msddl_selectItem 
{
    font-family: Arial;
    font-size: 9pt;
    background-color: #fff;
    color: Black !important;
    /*margin-left: 5px !important;*/
    vertical-align: top;
    margin: 0;
    padding-bottom: 1px;
    outline: none;
    border: 1px solid #c0c0c0;
    -webkit-border-radius: 1px;
    -moz-border-radius: 1px;
    border-radius: 1px;
}
.msddl_selectListToggle 
{
    display: block;
}
.selectorCatcher {
    border: 0px; 
    border-image: none; 
    width: 1px; 
    background-color: transparent
}
.msddl_selectListToggleIcon
{
    display: none;
}
.msddl_selectedCount 
{
    display: inline-block;
}
.msddl_selectList ul
{
    border: 0;
    display: none;
    padding: 5px;
    list-style: none;
}
.msddl_selectList li 
{
    padding: 2px 0;
    -webkit-border-radius: 1px;
    -moz-border-radius: 1px;
    border-radius: 1px;
    -webkit-transition: all 0.1s ease;
    -moz-transition: all 0.1s ease;
    -ms-transition: all 0.1s ease;
    -o-transition: all 0.1s ease;
}
.msddl_selectList li:hover
{
    background-color: rgba(81, 203, 238, 1);
}
.msddl_selectListFlyout .msddl_selectList
{
    position: relative;
}
.msddl_selectListFlyout ul
{
    background-color: #fff;
    margin: 0;
    display: none;
    position: absolute;
    top: 2px;
    min-width: 95%;
    max-height: 200px;
    overflow-y: auto;
    -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
    -moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
    box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
}
.msddl_selectListFlyout...

JavaScript

$(document).ready(function() {
    var el = $(".msddl_selectItem");
    el.find(".msddl_selectListToggle").on("click", function () {
        var container = $(this).parents(".msddl_selectItem");
        var list = container.find("ul");
        if (list.is(":visible")) {
            list.slideUp("fast");
        } else {
            list.slideDown("fast");
        }
    });
});