自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

CSS 3 閃爍跳躍的進度條

開發(fā) 前端
這個示例的原理和以前的都是一樣的,都是通過大量的css3屬性來實現(xiàn)的,如:animation、transform、keyframes等等屬性。值得注意的是這個示例采用了結(jié)構(gòu)性偽類選擇符E:nth-child(n),來進行對HTML元素的選擇以及控制輸出。

之前為大家分享過一篇關(guān)于css3進度條的一篇文章《實現(xiàn)CSS3動態(tài)進度條及JQUERY百分比數(shù)字顯示》,今天為大家?guī)砹硪豢罡邆€性化的進度條:CSS3閃爍跳躍的進度條。

flashing-jumping-progress-bar

查看預(yù)覽  下載附件

這個示例的原理和以前的都是一樣的,都是通過大量的css3屬性來實現(xiàn)的,如:animation、transform、keyframes等等屬性。值得注意的是這個示例采用了結(jié)構(gòu)性偽類選擇符E:nth-child(n),來進行對HTML元素的選擇以及控制輸出。相信這個偽類選擇符在將來會是一個很強大的一個工具。推薦大家多多了解以及實踐使用。

這個偽類選擇符E:nth-child(n)的含義是匹配父元素的第n個子元素E。 例如:ul li:nth-child(3)表示的是選擇<ul>元素里面的第3個<li>。提示一下,該屬性在IE8(包含IE8)版本以下是不支持的。下面就一起來看看該示例的實現(xiàn)代碼吧,完整的代碼可下載附件查看。

HTML結(jié)構(gòu)代碼

  1. <div class="center"> 
  2.   <ul> 
  3.     <li> 
  4.       <div></div> 
  5.     </li> 
  6.     <li> 
  7.       <div></div> 
  8.     </li> 
  9.     <li> 
  10.       <div></div> 
  11.     </li> 
  12.     <li> 
  13.       <div></div> 
  14.     </li> 
  15.     <li> 
  16.       <div></div> 
  17.     </li> 
  18.     <li> 
  19.       <div></div> 
  20.     </li> 
  21.     <li> 
  22.       <div></div> 
  23.     </li> 
  24.   </ul> 
  25. </div> 

CSS樣式代碼

  1.  @keyframes bump {  
  2.  0% {  
  3.  opacity: 0;  
  4.  left: 535px;  
  5. }  
  6.  100% {  
  7.  left: -10px;  
  8.  opacity: 0;  
  9. }  
  10.  10%85% {  
  11.  opacity: 1;  
  12. }  
  13. }  
  14.  @keyframes spin {  
  15.  0%100% {  
  16.  height20px;  
  17.  top: 50px;  
  18. }  
  19.  50% {  
  20.  height100px;  
  21.  top: 0;  
  22. }  
  23. }  
  24. body {  
  25.     background: rgba(0000.2);  
  26. }  
  27. div.center {  
  28.     text-aligncenter;  
  29.     margin-top40px;  
  30. }  
  31. ul {  
  32.     background-color: rgba(2552552550.4);  
  33.     positionrelative;  
  34.     displayblock;  
  35.     padding0;  
  36.     marginauto;  
  37.     width600px;  
  38.     height10px;  
  39.     list-stylenone;  
  40.     border-radius: 200px;  
  41.     border5px solid rgba(2552552550.2);  
  42.     margin-top100px;  
  43.     box-shadow: 0 0 5px 5px rgba(0000.1);  
  44. }  
  45. ul li {  
  46.     positionabsolute;  
  47.     margin-top-55px;  
  48. }  
  49. ul li:nth-child(1) {  
  50.     animation: bump 1.5s infinite;  
  51.     animation-delay: 0.1s;  
  52. }  
  53. ul li:nth-child(1) div {  
  54.     border-radius: 22px;  
  55.     transform-origin: center;  
  56.     positionabsolute;  
  57.     height60px;  
  58.     width80px;  
  59.     animation: spin 0.4s infinite;  
  60.     animation-delay: 0.1s;  
  61.     background-color: rgba(1201201200.3);  
  62. }  
  63. ul li:nth-child(2) {  
  64.     animation: bump 1.5s infinite;  
  65.     animation-delay: 0.2s;  
  66. }  
  67. ul li:nth-child(2) div {  
  68.     border-radius: 22px;  
  69.     transform-origin: center;  
  70.     positionabsolute;  
  71.     height60px;  
  72.     width80px;  
  73.     animation: spin 0.4s infinite;  
  74.     animation-delay: 0.2s;  
  75.     background-color: rgba(120000.3);  
  76. }  
  77. ul li:nth-child(3) {  
  78.     animation: bump 1.5s infinite;  
  79.     animation-delay: 0.3s;  
  80. }  
  81. ul li:nth-child(3) div {  
  82.     border-radius: 22px;  
  83.     transform-origin: center;  
  84.     positionabsolute;  
  85.     height60px;  
  86.     width80px;  
  87.     animation: spin 0.4s infinite;  
  88.     animation-delay: 0.3s;  
  89.     background-color: rgba(12012000.3);  
  90. }  
  91. ul li:nth-child(4) {  
  92.     animation: bump 1.5s infinite;  
  93.     animation-delay: 0.4s;  
  94. }  
  95. ul li:nth-child(4) div {  
  96.     border-radius: 22px;  
  97.     transform-origin: center;  
  98.     positionabsolute;  
  99.     height60px;  
  100.     width80px;  
  101.     animation: spin 0.4s infinite;  
  102.     animation-delay: 0.4s;  
  103.     background-color: rgba(012000.3);  
  104. }  
  105. ul li:nth-child(5) {  
  106.     animation: bump 1.5s infinite;  
  107.     animation-delay: 0.5s;  
  108. }  
  109. ul li:nth-child(5) div {  
  110.     border-radius: 22px;  
  111.     transform-origin: center;  
  112.     positionabsolute;  
  113.     height60px;  
  114.     width80px;  
  115.     animation: spin 0.4s infinite;  
  116.     animation-delay: 0.5s;  
  117.     background-color: rgba(01201200.3);  
  118. }  
  119. ul li:nth-child(6) {  
  120.     animation: bump 1.5s infinite;  
  121.     animation-delay: 0.6s;  
  122. }  
  123. ul li:nth-child(6) div {  
  124.     border-radius: 22px;  
  125.     transform-origin: center;  
  126.     positionabsolute;  
  127.     height60px;  
  128.     width80px;  
  129.     animation: spin 0.4s infinite;  
  130.     animation-delay: 0.6s;  
  131.     background-color: rgba(001200.3);  
  132. }  
  133. ul li:nth-child(7) {  
  134.     animation: bump 1.5s infinite;  
  135.     animation-delay: 0.7s;  
  136. }  
  137. ul li:nth-child(7) div {  
  138.     border-radius: 22px;  
  139.     transform-origin: center;  
  140.     positionabsolute;  
  141.     height60px;  
  142.     width80px;  
  143.     animation: spin 0.4s infinite;  
  144.     animation-delay: 0.7s;  
  145.     background-color: rgba(12001200.3);  

注:請自行在所需之處加上瀏覽器前綴(如:-webkit- 、 -moz-),否則將不能正常顯示效果。

原文鏈接:http://www.jiawin.com/flashing-jumping-progress-bar/

責(zé)任編輯:張偉 來源: 覺唯
相關(guān)推薦

2024-12-02 09:37:51

2015-07-31 11:19:43

數(shù)字進度條源碼

2023-11-30 11:38:29

CSS網(wǎng)頁進度條

2021-11-02 07:44:36

CSS 技巧進度條

2011-07-05 15:16:00

QT 進度條

2024-08-06 14:29:37

2012-12-24 11:13:17

CSSjQueryJavaScript

2015-01-12 12:13:03

Android進度條ProgressDia

2024-04-01 08:18:52

CSSHTMLWeb

2015-01-12 09:30:54

Android進度條ProgressDia

2015-08-03 11:39:20

擬物化進度條

2024-07-04 11:25:34

2009-06-06 18:54:02

JSP編程進度條

2023-12-11 17:15:05

應(yīng)用開發(fā)波紋進度條ArkUI

2012-01-17 13:58:17

JavaSwing

2024-07-25 08:55:47

進度條水缸進度動畫效果

2024-06-13 08:15:00

2012-07-31 09:53:33

HTML5進度條

2009-08-17 15:48:47

C# WinForm進

2009-08-17 14:41:47

C#進度條實現(xiàn)
點贊
收藏

51CTO技術(shù)棧公眾號