Created
April 13, 2014 12:33
-
-
Save probil/10582145 to your computer and use it in GitHub Desktop.
Simple method to create row with description that slide out when you click on it.
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
.desc-row td{ | |
margin: 0 !important; | |
padding: 0 !important; | |
border: 0 !important; | |
} | |
.description{ | |
padding: 5px 8px; | |
border-bottom: 1px solid #ddd; | |
} | |
.table-row{ | |
cursor:pointer; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script> | |
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<table class="table table-bordered table-responsive table-hover "> | |
<tr class="table-row"> | |
<td>Name</td> | |
<td>Platforms</td> | |
<td>Description</td> | |
</tr> | |
<tr class="desc-row"> | |
<td colspan="3"> | |
<div style="display:none" class="description"> | |
<p> | |
Simple text | |
</p> | |
</div> | |
</td> | |
</tr> | |
</table> | |
</body> | |
</html> |
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
$(".table-row").on('click',function(){ | |
"use strict"; | |
$(this).next().children(1).children(1).slideToggle("fast"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple method to create row with description that slide out when you click on it.