语义UI淡入/淡出过渡

时间:2016-10-14 23:18:57

标签: html5 semantic-ui

语义用户界面的文档确实提供了transitions的链接,但缺少'fade in''fade out'效果的条目。它们是未来的版本吗?

1 个答案:

答案 0 :(得分:2)

虽然文档中未明确提及,但语义UI中的所有动画都可以使用修饰符out// Will fade out the leaf if it's visible, otherwise fades in. $('.autumn.leaf').transition('fade'); // Will always fade in the leaf. If it's visible, it will first hide it immediately, then fade it in. $('.autumn.leaf').transition('fade in'); // Will always fade out the leaf. If it's hidden, it will first show it immediately, then fade it out. $('.autumn.leaf').transition('fade out'); 来强制动画向内或向外。

fade

我个人建议你避免使用它们 - 你应该知道元素的当前可见性,并使用正常的// Only fade in the leaf if it's hidden, otherwise do nothing. if ($('.autumn.leaf').hasClass('hidden')) { $('.autumn.leaf').transition('fade'); } 转换:

<tbody>
  <tr class='even'>
    <th>header 1</th>
    <td>11</td>
    <td>12</td>
  </tr>
  <tr class='even'>
    <th>header 2</th>
    <td>21</td>
    <td>22</td>
  </tr>
</tbody>