Detach from list


List item
List item
List item
List item
List item
List item
List item
List item
List item
List item


HTML:
<div id='outerCont'>
    <div id='listCont'>
        <div class='listItem'>
            List item
        </div>
        <div class='listItem'>
            List item
        </div>
        ...
    </div>
</div>

CSS:
#outerCont {
	height: 300px;
	overflow: auto;
	border: 1px solid #777777;
}

#listCont {
	position: relative;
}

.listItem {
	padding: 1.4em;
	background-color: #FFFFFF;
	border-bottom: 1px solid #DDDDDD;
}

JS:
function attachToList() {
    lithiumlist.attachToList(
	    '123456789',
	    document.getElementById('outerCont'),
	    document.getElementById('listCont'),
	    'listItem'
    );
}

function detachFromList() {
	lithiumlist.detachFromList(document.getElementById('listCont'));
}

attachToList();

var aDetach = document.getElementById('a-detach');
aDetach.addEventListener('click', function() {
	detachFromList();
});

var aAttach = document.getElementById('a-attach');
aAttach.addEventListener('click', function() {
	attachToList();
});