jquery - it expands row when i click on a row but i want to expand row only when i click on a button -
below code expands row when click on row want expand row when click on button. have image/button on each row.
jquery code
$('.rowtoclick').click(function () { $(this).nextall('tr').each( function() { if ($(this).is('.rowtoclick')) { return false; } $(this).toggle(350); }); });
my html
<tr class="rowtoclick" > <td><img src="plus.png" > </td> <td><?php echo $id;?> </td> <td><?php echo $name;?> </td> </tr> <tr id="i"> <td> </td> <td> </td> <td style="width:250px;"> <b>phone: </b><?php echo $phone;?> <br> <b>email: </b><?php echo $email; ?><br> <tr>
html:
<button type="submit" class="link">link</button>
strong text
$('.link').click(function () { $(this).nextall('tr').each( function() { if ($(this).is('.rowtoclick')) { return false; } $(this).toggle(350); }); });
Comments
Post a Comment