Last active
August 31, 2016 12:28
-
-
Save owngeek/be6bc7deb60eebe0cbc1a85a1048b556 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
#collapse * { | |
display:block; | |
list-style:none; | |
cursor:pointer; | |
text-transform:uppercase; | |
} | |
#collapse ul li { | |
} | |
.open{} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul id="collapse"> | |
<li> level > | |
<ul> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3 | |
<ul> | |
<li>level 4</li> | |
<li>level 4</li> | |
<li>level 4</li> | |
<li>level 4</li> | |
</ul> | |
</li> | |
<li>level 3 | |
<ul> | |
<li>level 4</li> | |
<li>level 4</li> | |
<li>level 4</li> | |
<li>level 4</li> | |
</ul> | |
</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
</ul> | |
</li> | |
<li> | |
level > | |
<ul> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
</ul> | |
</li> | |
<li> | |
level > | |
<ul> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
<li>level 2 | |
<ul> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
<li>level 3</li> | |
</ul> | |
</li> | |
</ul> | |
</li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://code.jquery.com/jquery-1.11.3.js"></script> | |
<script> | |
$(function () { | |
$("#collapse li").children('ul').hide(); | |
$("#collapse li").on('click', function (event) { | |
$(this).children('ul').stop().slideToggle(350); | |
$(this).toggleClass("open"); | |
event.stopPropagation(); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment