How to prevent a jQuery widget appended to a selectable from growing bigger onmouseover?

How to prevent a jQuery widget appended to a selectable from growing bigger onmouseover?

Hello dear jQuery UI developers and users!

In an HTML game I have created a custom jQuery widget called table representing a rectangle green table with up to 4 players sitting at it:


In the above screenshot 4 such tables are appended to a #tables3 selectable by the following code:

  1. var tablesList = $('#selectable').selectable();

  2. var table1 = $('<li/>').appendTo(tables3).table({ gid: 3 });
  3. var table2 = $('<li/>').appendTo(tables3).table({
  4.     gid: 104,
  5.     player0: {
  6.         rep: Math.random(),
  7.         photo: 'http://afarber.de/images/farber.jpg'
  8.     }
  9. });
  10. var table3 = $('<li/>').appendTo(tables3).table({
  11.     gid: 115,
  12.     player0: {
  13.         rep: Math.random()
  14.     },
  15.     player1: {
  16.     },
  17.     player2: {
  18.         rep: Math.random(),
  19.         photo: 'https://raspasy.de/raspasy/images/male_sad.png'
  20.     },
  21.     player3: {
  22.         rep: Math.random(),
  23.         photo: 'https://raspasy.de/raspasy/images/female_happy.png'
  24.     }
  25. });
  26. var table4 = $('<li/>').appendTo(tables3).table({
  27.     gid: 115,
  28.     player0: {
  29.         photo: 'https://raspasy.de/raspasy/images/female_happy.png'
  30.     },
  31.     player1: {
  32.         rep: Math.random(),
  33.         photo: 'https://raspasy.de/raspasy/images/female_sad.png'
  34.     },
  35.     player2: {
  36.         rep: Math.random(),
  37.         photo: 'https://raspasy.de/raspasy/images/male_sad.png'
  38.     },
  39.     player3: {
  40.         rep: Math.random(),
  41.         photo: 'https://raspasy.de/raspasy/images/female_happy.png'
  42.     }
  43. });

The #tablesList has the CSS property overflow-y: set to scroll:

  1. #selectable .ui-selecting { background: #FECA40; }
  2. #selectable .ui-selected  { background: #F39814; color: white; }
  3. #selectable { 
  4.     list-style-type:    none; 
  5.     margin:             0;
  6.     padding:            0;
  7.     height:             500px;
  8.     overflow-y:         scroll;
  9. }

My problem is: when I hover the mouse pointer over one of the table widgets, then it seems to change into some CSS state with slightly bigger dimensions and thus pushes the right tables to the next row in the #tables3:

Screenshot 1 (the mouse is over the second table):


Screenshot 2 (the mouse is over the third table):

As you can see, the fourth table is always pushed down. And if I move the mouse pointer away, this creates an annoying flickering effect, where the 4th table changes between the 1st and 2nd rows.

My question is how to prevent this please? I have tried inspecting CSS in the browser dev. tools but failed to spot any related CSS property.

My CSS file style.css is listed below and you can see the ugly effect by visiting the game web page (it requires Google oAuth though, sorry for that):

  1. #selectable .ui-selecting { background: #FECA40; }
  2. #selectable .ui-selected  { background: #F39814; color: white; }
  3. #selectable { 
  4.     list-style-type:    none; 
  5.     margin:             0;
  6.     padding:            0;
  7.     height:             500px;
  8.     overflow-y:         scroll;
  9. }

  10. body {
  11.     font-family: Arial, Helvetica, sans-serif;
  12. }

  13. fieldset {
  14.     border: 0px;
  15. }

  16. .ui-draggable, 
  17. .ui-droppable {
  18.     background-position: top;
  19. }

  20. #gameDiv {
  21.     position: relative;
  22. }

  23. #gameCanvas {
  24.     background: radial-gradient(#FFFFFF, #99CC99);
  25. }

  26. :-webkit-full-screen,
  27. :-moz-full-screen,
  28. :-ms-fullscreen,
  29. :fullscreen {
  30.     background: #FFF;
  31. }

  32. #lobbyTable {
  33.     background: #FFF;
  34. }

  35. #kukuSlider {
  36.     width:          300px;
  37.     margin:         15px;
  38. }

  39. #red, #green, #blue {
  40.     width:          300px;
  41.     margin:         15px;
  42. }

  43. #swatch {
  44.     padding:        10px;
  45.     margin:         5px;
  46.     color:          #FFF;
  47. }

  48. #red   .ui-slider-range  { background:   #ef2929; }
  49. #red   .ui-slider-handle { border-color: #ef2929; }
  50. #green .ui-slider-range  { background:   #8ae234; }
  51. #green .ui-slider-handle { border-color: #8ae234; }
  52. #blue  .ui-slider-range  { background:   #729fcf; }
  53. #blue  .ui-slider-handle { border-color: #729fcf; }

  54. .raspasy-player {
  55.     position:           relative;
  56.     background:         #FFF no-repeat center;
  57.     background-size:    contain;
  58.     box-shadow: 0 0 32px rgba(0, 0, 0, 0.2);
  59.     width:              160px;
  60.     height:             120px;
  61. }

  62. .raspasy-player-name {
  63.     position:           absolute;
  64.     font-size:          18px;
  65.     background:         #FFF;
  66.     color:              #000;
  67.     text-align:         left;
  68.     left:               0;
  69.     bottom:             0;
  70.     padding:            2px;
  71.     width:              156px;
  72.     height:             20px;
  73. }

  74. .raspasy-player-bid {
  75.     position:           absolute;
  76.     font-size:          18px;
  77.     background:         #FFF;
  78.     color:              #000;
  79.     text-align:         right;
  80.     right:              0;
  81.     top:                0;
  82.     padding:            2px;
  83.     width:              36px;
  84.     height:             20px;
  85. }

  86. .raspasy-player-trix {
  87.     position:           absolute;
  88.     font-size:          18px;
  89.     background:         #FFF;
  90.     color:              #000;
  91.     text-align:         right;
  92.     right:              0;
  93.     bottom:             0;
  94.     padding:            2px;
  95.     width:              36px;
  96.     height:             20px;
  97. }

  98. .raspasy-player-rep {
  99.     position:           absolute;
  100.     right:              0;
  101.     bottom:             0;
  102. }

  103. .raspasy-player-bad-big {
  104.     position:           relative;
  105.     background:         #C00;
  106.     width:              50px;
  107.     height:             1px;
  108.     display:            none;
  109. }

  110. .raspasy-player-bad-small {
  111.     position:           relative;
  112.     background:         #C00;
  113.     width:              25px;
  114.     height:             1px;
  115.     display:            none;
  116. }

  117. .raspasy-player-good-big {
  118.     position:           relative;
  119.     background:         #6C6;
  120.     width:              50px;
  121.     height:             1px;
  122.     display:            none;
  123. }

  124. .raspasy-player-good-small {
  125.     position:           relative;
  126.     background:         #6C6;
  127.     width:              25px;
  128.     height:             1px;
  129.     display:            none;
  130. }

  131. .raspasy-table {
  132.     position:           relative;
  133.     background:         #A3DD8E;
  134.     color:              white;
  135.     margin:             50px; 
  136.     float:              left; 
  137.     border:             4px solid #91BCE5;
  138.     border-radius:      16px;
  139.     box-shadow: 0 0 32px rgba(0, 0, 0, 0.2);
  140.     width:              160px; 
  141.     height:             160px; 
  142. }

  143. .raspasy-table-gid {
  144.     position:           absolute;
  145.     font-size:          1.5em; 
  146.     top:                65px;
  147.     width:              100%;
  148.     color:              white;
  149.     text-align:         center; 
  150. }

  151. .raspasy-table-player0 {
  152.     position:           absolute;
  153.     left:               -40px;
  154.     top:                50px;
  155.     background:         #FFF no-repeat center;
  156.     background-size:    contain;
  157.     box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  158.     width:              80px;
  159.     height:             60px;
  160.     display:            none;
  161. }

  162. .raspasy-table-player1 {
  163.     position:           absolute;
  164.     left:               40px;
  165.     top:                -30px;
  166.     background:         #FFF no-repeat center;
  167.     background-size:    contain;
  168.     box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  169.     width:              80px;
  170.     height:             60px;
  171.     display:            none;
  172. }

  173. .raspasy-table-player2 {
  174.     position:           absolute;
  175.     left:               120px;
  176.     top:                50px;
  177.     background:         #FFF no-repeat center;
  178.     background-size:    contain;
  179.     box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  180.     width:              80px;
  181.     height:             60px;
  182.     display:            none;
  183. }

  184. .raspasy-table-player3 {
  185.     position:           absolute;
  186.     left:               40px;
  187.     top:                130px;
  188.     background:         #FFF no-repeat center;
  189.     background-size:    contain;
  190.     box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  191.     width:              80px;
  192.     height:             60px;
  193.     display:            none;
  194. }

Thank you for any hints
Alex