千家信息网

如何实现基于css3的列表toggle特效

发表于:2025-11-12 作者:千家信息网编辑
千家信息网最后更新 2025年11月12日,这篇文章主要讲解了"如何实现基于css3的列表toggle特效",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"如何实现基于css3的列表toggle特效
千家信息网最后更新 2025年11月12日如何实现基于css3的列表toggle特效

这篇文章主要讲解了"如何实现基于css3的列表toggle特效",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"如何实现基于css3的列表toggle特效"吧!

  实现的代码。

  htm代码:

复制内容到剪贴板

  1. class='menu'>

  2. toggle visibility

    • class='list reverse'>

    • class='item'>Item 1
    • class='item'>Item 2
    • class='item'>Item 3
    • class='item'>Item 4
    • class='item'>Item 5
    • class='item'>Item 6
    • class='item'>Item 7
    • class='item'>Item 8
    • class='item'>Item 9
    • class='item'>Item 10
    • class='item'>Item 11
    • class='item'>Item 12

  •   css3代码:

    CSS Code复制内容到剪贴板

    1. * {

    2. -moz-box-sizing: border-box;

    3. box-sizing: border-box;

    4. }

    5. body {

    6. margin: 0;

    7. padding: 0;

    8. font-family: 'Avenir Next';

    9. background: #000;

    10. color: white;

    11. }

    12. .menu {

    13. background: tomato;

    14. padding: 20px;

    15. position: absolute;

    16. z-index: 1;

    17. height: 55px;

    18. top: 0;

    19. rightright: 50px;

    20. }

    21. .list {

    22. -webkit-perspective: 100vw;

    23. perspective: 100vw;

    24. width: 100vw;

    25. height: 100vh;

    26. display: -webkit-flex;

    27. display: -ms-flexbox;

    28. display: flex;

    29. -webkit-flex-flow: column wrap;

    30. -ms-flex-flow: column wrap;

    31. flex-flow: column wrap;

    32. }

    33. .list.hidden {

    34. pointer-events: none;

    35. }

    36. .list.hidden .item {

    37. -webkit-animation: disappear both;

    38. animation: disappear both;

    39. -webkit-animation-direction: alternate;

    40. animation-direction: alternate;

    41. }

    42. .list.reverse {

    43. -webkit-flex-flow: row-reverse wrap-reverse;

    44. -ms-flex-flow: row-reverse wrap-reverse;

    45. flex-flow: row-reverse wrap-reverse;

    46. }

    47. .item {

    48. font-size: 30px;

    49. padding: 20px;

    50. height: 100px;

    51. width: calc(100vw / 3);

    52. height: calc(100vh / 4);

    53. -webkit-animation: appear both;

    54. animation: appear both;

    55. }

    56. .item:nth-child(1) {

    57. background: #008a8a;

    58. -webkit-animation-delay: 0.03333s !important;

    59. -webkit-animation-duration: 0.1s !important;

    60. }

    61. .item:nth-child(2) {

    62. background: #009494;

    63. -webkit-animation-delay: 0.06667s !important;

    64. -webkit-animation-duration: 0.2s !important;

    65. }

    66. .item:nth-child(3) {

    67. background: #009f9f;

    68. -webkit-animation-delay: 0.1s !important;

    69. -webkit-animation-duration: 0.3s !important;

    70. }

    71. .item:nth-child(4) {

    72. background: #00a9a9;

    73. -webkit-animation-delay: 0.13333s !important;

    74. -webkit-animation-duration: 0.4s !important;

    75. }

    76. .item:nth-child(5) {

    77. background: #00b3b3;

    78. -webkit-animation-delay: 0.16667s !important;

    79. -webkit-animation-duration: 0.5s !important;

    80. }

    81. .item:nth-child(6) {

    82. background: #00bdbd;

    83. -webkit-animation-delay: 0.2s !important;

    84. -webkit-animation-duration: 0.6s !important;

    85. }

    86. .item:nth-child(7) {

    87. background: #00c7c7;

    88. -webkit-animation-delay: 0.23333s !important;

    89. -webkit-animation-duration: 0.7s !important;

    90. }

    91. .item:nth-child(8) {

    92. background: #00d2d2;

    93. -webkit-animation-delay: 0.26667s !important;

    94. -webkit-animation-duration: 0.8s !important;

    95. }

    96. .item:nth-child(9) {

    97. background: #00dcdc;

    98. -webkit-animation-delay: 0.3s !important;

    99. -webkit-animation-duration: 0.9s !important;

    100. }

    101. .item:nth-child(10) {

    102. background: #00e6e6;

    103. -webkit-animation-delay: 0.33333s !important;

    104. -webkit-animation-duration: 1s !important;

    105. }

    106. .item:nth-child(11) {

    107. background: #00f0f0;

    108. -webkit-animation-delay: 0.36667s !important;

    109. -webkit-animation-duration: 1.1s !important;

    110. }

    111. .item:nth-child(12) {

    112. background: #00fafa;

    113. -webkit-animation-delay: 0.4s !important;

    114. -webkit-animation-duration: 1.2s !important;

    115. }

    116. @-webkit-keyframes appear {

    117. from {

    118. opacity: 0;

    119. -webkit-transform: scale(0.8);

    120. transform: scale(0.8);

    121. }

    122. to {

    123. opacity: 1;

    124. -webkit-transform: scale(1);

    125. transform: scale(1);

    126. }

    127. }

    128. @keyframes appear {

    129. from {

    130. opacity: 0;

    131. -webkit-transform: scale(0.8);

    132. transform: scale(0.8);

    133. }

    134. to {

    135. opacity: 1;

    136. -webkit-transform: scale(1);

    137. transform: scale(1);

    138. }

    139. }

    140. @-webkit-keyframes disappear {

    141. from {

    142. opacity: 1;

    143. -webkit-transform: scale(1);

    144. transform: scale(1);

    145. }

    146. to {

    147. opacity: 0;

    148. -webkit-transform: scale(0.9) rotateX(0deg) translateZ(-1500px);

    149. transform: scale(0.9) rotateX(0deg) translateZ(-1500px);

    150. }

    151. }

    152. @keyframes disappear {

    153. from {

    154. opacity: 1;

    155. -webkit-transform: scale(1);

    156. transform: scale(1);

    157. }

    158. to {

    159. opacity: 0;

    160. -webkit-transform: scale(0.9) rotateX(0deg) translateZ(-1500px);

    161. transform: scale(0.9) rotateX(0deg) translateZ(-1500px);

    162. }

    163. }

    感谢各位的阅读,以上就是"如何实现基于css3的列表toggle特效"的内容了,经过本文的学习后,相信大家对如何实现基于css3的列表toggle特效这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!

    特效 内容 代码 学习 剪贴板 剪贴 就是 思路 情况 文章 更多 知识 知识点 篇文章 跟着 问题 实践 推送 研究 验证 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 关于网络技术的文章 服务器机房设计方案 服务器上班时间延后怎么办 有关网络安全的黑板报大学生 中文wiki图片数据库 网络安全屏障图解 青岛软件开发公司哪家靠谱 ftp服务器上是不能下载文件的 人民日报官方微博的数据库 二战中的数据库 连云港火柴网络技术有限公司 智能边缘计算服务器厂家供应 泰拉瑞亚进不去服务器该怎么办 网络安全一般是指网络系统硬件 南自华盾网络安全 软件开发的201个原则 豆瓣 泰兴小型网络技术诚信服务 网络安全和渗透测试一吗 软件开发部部门架构图 教资注册显示内部服务器错误 连接数据库时间 有在医院做软件开发的吗 fifa22 怎么选择服务器 软件开发电话技术面试问题 数据库表查询第一列 深圳腾汇翔互联网科技 成立医院网络安全领导小组 东鼎网络技术有限公司 手抄报网络安全还可以写什么 研祥软件开发怎么样
    0