When using jQuery slideToggle()
function to show/hide data on a new row in a table it causes it to stutter. Yet, when using slideToggle()
to show/hide a <div>
it works very smoothly.
Can anyone tell me why this happens?
Fiddle example: http://jsfiddle.net/gLGUG/
jQuery code:
$("tr").click(function () {
$(".slideMe").slideToggle();
});
$(".slideMeDiv, button").click(function () {
$(".slideMeDiv").slideToggle();
});
HTML Markup:
<table>
<tr>
<td>One Row</td>
</tr>
<tr>
<td>Click me</td>
</tr>
<tr class="slideMe">
<td>SlideDOWN</td>
</tr>
</table>
<br />
<button>Slide Div</button>
<div class="slideMeDiv">
Slide me as well
</div>