Advertisement
Guest User

foobar

a guest
Nov 26th, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>foobar</title>
  5.         <script type="text/javascript" src="js/jquery.js" language="javascript"></script>
  6.         <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
  7.         <style type="text/css">
  8.             tr {
  9.                 cursor: pointer;
  10.                 display: block;
  11.                 border: 1px solid #ff0000;
  12.             }
  13.         </style>
  14.         <script type="text/javascript">
  15.             (function($){
  16.                 $(document).delegate('table tr', 'click', function(e){
  17.                     $('a', this).trigger('click');
  18.                 });
  19.                 $(document).delegate('tr a', 'click', function(e){
  20.                     console.log("it works!");
  21.                     //e.stopPropagation(); // use this if you want normal click behaviour without stackoverflow
  22.                     return false; // use this if you don't want normal click behaviour and no propagation
  23.                 });            
  24.             })(jQuery);
  25.         </script>
  26.     </head>
  27.     <body>
  28.         <table class="table-list">
  29.             <tbody>
  30.                 <tr>
  31.                      <td>...</td>
  32.                      <td><a href="/link">Link</a></td>
  33.                 </tr>
  34.             </tbody>
  35.         </table>
  36.     </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement