Hello all,
here is my Testcode:
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
- <table id="idTable" border="1">
- <tbody>
- <tr>
- <td>foo</td>
- <td>bar</td>
- </tr>
- <tr>
- <td>foo</td>
- <td>bar</td>
- </tr>
- </tbody>
- </table>
- <script language="javascript" type="text/javascript">
- $('#idTable').delegate('tbody > tr > td:nth-child(1)', 'mouseup', function(event)
- {
- alert('clicked td');
- return false;
- }
- );
- $('#idTable').delegate('tbody > tr', 'click', function(event)
- {
- alert('clicked tr');
- return false;
- }
- );
- </script>
My expected outcome is:
1) click on any foo alert "clicked td"
2) click on any bar alert "clicked tr"
Real outcome is:
1) click on any foo alert "clicked td" AND "clicked tr"
2) click on any bar alert "clicked tr"
in the documentation i found
To cancel a default action and prevent it from bubbling up, return false
This does not work for me.
Can anyone help me?
thx Mike