Skip to content

Instantly share code, notes, and snippets.

@mustmodify
Created April 24, 2012 18:44
Show Gist options
  • Save mustmodify/2482533 to your computer and use it in GitHub Desktop.
Save mustmodify/2482533 to your computer and use it in GitHub Desktop.
Slider Components
tr.slider {
display: none;
}
<table>
<tr class="handle">
<td></td>
<td></td>
</tr>
<tr class="slider">
<td colspan="2">
</td>
</tr>
<tr class="handle">
<td></td>
<td></td>
</tr>
<tr class="slider">
<td colspan="2">
</td>
</tr>
</table>
$(function(){
$('tr.handle input').bind('click', function(event){
event.stopPropagation();
});
$('tr.slider').prev().css('cursor', 'pointer');
$('tr.slider').prev().bind('click', function() {
slider_row = $(this).next();
if( slider_row.css('display') == 'none' )
{
slider_row.show();
}
else
{
slider_row.hide();
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment