0

It seems that when using "transform: scale()" it temporarily blurs the image and text. My fiddle and code:

HTML:

<table>
  <tbody>
    <tr>
      <!-- The current Image Sources are just PLACEHOLDERS. It is not the final img sources path. -->
      <td>
        <img src="http://opensource.org/files/osi_keyhole_100X100_90ppi.png" width="100px" height="100px">
        <div class="rndSpacing1">The Test</div>
      </td>
      <td>
        <img src="http://opensource.org/files/osi_keyhole_100X100_90ppi.png" width="100px" height="100px">
        <div class="rndSpacing2">Testtest Testtesttesttest</div>
      </td>a
      <td>
        <img src="http://opensource.org/files/osi_keyhole_100X100_90ppi.png" width="100px" height="100px">
        <div class="rndSpacing1">TESt</div>
      </td>
      <td>
        <img src="http://opensource.org/files/osi_keyhole_100X100_90ppi.png" width="100px" height="100px">
        <div class="rndSpacing1">Testt TesttTest</div>
      </td>
    </tr>
    <tr>
      <td>
        <img src="http://opensource.org/files/osi_keyhole_100X100_90ppi.png" width="100px" height="100px">
        <div class="rndSpacing2">TestTest Testtest</div>
      </td>
      <td>
        <img src="http://opensource.org/files/osi_keyhole_100X100_90ppi.png" width="100px" height="100px">
        <div class="rndSpacing2">Test Testtest tests</div>
      </td>
      <td>
        <img src="http://opensource.org/files/osi_keyhole_100X100_90ppi.png" width="100px" height="100px">
        <div class="rndSpacing2">testtest testtest</div>
      </td>
      <td>
        <img src="http://opensource.org/files/osi_keyhole_100X100_90ppi.png" width="100px" height="100px">
        <div class="rndSpacing1">Testtesttesttest</div>
      </td>
    </tr>
  </tbody>
</table>

CSS:

    table, th, td {
    border: 1px solid #8a9398;
    border-collapse: collapse;
    box-shadow: inset 1px 1px 0px 1px white;
    table-layout: fixed;
}
td {
  text-align: center;
  width: 148px;
  height: 180px;
  color: #48515b;
  cursor: pointer;
}
td:hover{
  -ms-transition-duration: 0.2s;
        -ms-transform: scale(1.1);
    -webkit-transition-duration: 0.2s;
        -webkit-transform: scale(1.1);
  box-shadow: 0 0 0 0;
}
td:active {
  -ms-transition-duration: 0.1s;
        -ms-transform: scale(0.95);
    -webkit-transition-duration: 0.1s;
        -webkit-transform: scale(0.95);
  box-shadow: 0 0 0 0;
}

I've tried a few workarounds, such as using width and height with transition, but that makes all the other table-cells expand. Any way around this?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Chizbe Joe
  • 35
  • 1
  • 8

2 Answers2

0

Make initial size the largest scale you're going to, and start it initially with a lower scale. Here is a fiddle You will have to make your width of your td bigger but add padding

Read more

Community
  • 1
  • 1
Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
  • Didn't work... But no matter. I figured it out on my own. I just gave the contents of each table-cell their own div and then used width with transition to make the hover effect. – Chizbe Joe Aug 11 '15 at 21:54
0

I solved it.

All you need to do is give the contents their own div within the table-cell, then use width and transition to make a hover effect. Make sure to give the table-cell "overflow: hidden".

Chizbe Joe
  • 35
  • 1
  • 8