Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <table id="waypointsTable" border="1">
  2. <tbody>
  3. <tr>
  4. <td>some text</td>
  5. </tr> ...
  6.  
  7. $('#waypointsTable > tbody > tr > td').hover(function() {
  8. alert(1);
  9. }, function() {
  10. alert(2);
  11. });
  12.  
  13. $('#waypointsTable tr').hover(function() {
  14. $(this).addClass('hover');
  15. }, function() {
  16. $(this).removeClass('hover');
  17. });
  18.  
  19. #waypointsTable tr:hover {
  20. background-color:yellow;
  21. }
  22.  
  23. <script type="text/javascript">
  24.  
  25. $("tr").not(':first').hover(
  26. function () {
  27. $(this).css("background","yellow");
  28. },
  29. function () {
  30. $(this).css("background","");
  31. }
  32. );
  33.  
  34. </script>
  35.  
  36. tr td { background: normal background style here }
  37. tr:hover td { background: hovered background style here}
  38.  
  39. $("#waypointsTable tr").not(':first').hover(function(){
  40. $(this).addClass("tr-hover");
  41. },function(){
  42. $(this).removeClass("tr-hover");
  43. }
  44. );
  45.  
  46. $("#table_id").on("mouseover", 'tr' function () {
  47. //stuff to do on mouseover
  48. });
  49.  
  50. $('#waypointsTable tr').hover(function() {
  51. $(this).toggleClass('hover');
  52. });
  53.  
  54. .hover {
  55. background-color:green;
  56. }
  57.  
  58. $(function () {
  59. $("tr:not(:has(th))").mouseover(function () {
  60. $(this).addClass("hover");
  61. });
  62. $("tr:not(:has(th))").mouseleave(function () {
  63. $(this).removeClass("hover");
  64. });
  65. });
  66.  
  67. .hover
  68. {
  69. background-color: #81B441;
  70. }
  71.  
  72. <table class="tblBorder" border='1'>
  73. <tr class="hover"><th>No</th><th>Page Name</th><th>No of View</th><th>Comments</th></tr>
  74. <tr><td>1</td><td>Java Script</td><td>28</td><td>10</td></tr>
  75. <tr><td>2</td><td>CSS</td><td>29</td><td>78</td></tr>
  76. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement