Hi,
I have a table, representing a calendar, that can expand and collapse table rows.
<tr class="parent" id="month1">
<th class="subheader">Januari</th>
<th></th><th></th>
</tr>
<tr class="row child-month1" id="day-1">
<td class="date"> 1 januari 2010</td>
<td>Bedrag </td>
<td>-817.0 </td>
</tr>
<tr class="row child-month1" id="day-2">
<td class="date"> 2 januari 2010</td>
<td>Bedrag </td>
<td> 0 </td>
</tr>
With jQuery I make it clickable:
<script type="text/javascript">
$(document).ready(function() {
$('tr.parent').click(function(){
$(this).siblings('.child-' + this.id).toggle();
return false;
});
});
</script>
The problem now, is that the window scrolls always to the top after a table row is clicked. I want it to stay at the scrolling position that it was before the click.
The child rows get collapsed as supposed to, but the document scrolls to the top immediately after the click, even though i have returned false at the end of .click... What am I doing wrong?
Thanks in advance!