javascript - 变换 : scale() Hover Blur

标签 javascript css html-table

似乎在使用“transform: scale()”时它会暂时模糊图像和文本。 My fiddle和代码:

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;
}

我已经尝试了一些变通方法,例如使用带过渡的宽度和高度,但这会使所有其他表格单元格展开。有什么办法解决这个问题吗?

最佳答案

将初始大小设置为您要达到的最大比例,并从较小的比例开始。这是一个 fiddle您将不得不使 td 的宽度更大,但添加 padding

Read more

关于javascript - 变换 : scale() Hover Blur,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31950225/

相关文章:

javascript - 悬停时更改表格内容?

Python BeautifulSoup : Iterating over a table

javascript - 未知的 Prop react

javascript - 使用基于 IP 地址的 JavaScript 隐藏元素

javascript - Laravel 5.5 Invisible Recaptcha 不提交表单

javascript - 检索内联 CSS 样式值

css - 转换网页字体格式是一个 "lossy"程序吗?

javascript - typescript :有没有像联合类型一样工作的东西,除了我们可以访问并非所有联合类型都通用的属性?

javascript - Safari 不重绘 css 动画上方的元素

javascript - 使用 jquery 根据背景颜色对表格行进行排序