最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

CSS3實(shí)現(xiàn)的閃爍跳躍進(jìn)度條示例(附源碼)

  發(fā)布時(shí)間:2013-08-19 17:48:19   作者:佚名   我要評論
原理是通過大量的css3屬性來實(shí)現(xiàn)的,如:animation、transform、keyframes等等屬性,示例采用了結(jié)構(gòu)性偽類選擇符E:nth-child(n),來進(jìn)行對HTML元素的選擇以及控制輸出,感興趣的朋友可以了解下
這個示例的原理是通過大量的css3屬性來實(shí)現(xiàn)的,如:animation、transform、keyframes等等屬性。值得注意的是這個示例采用了結(jié)構(gòu)性偽類選擇符E:nth-child(n),來進(jìn)行對HTML元素的選擇以及控制輸出。相信這個偽類選擇符在將來會是一個很強(qiáng)大的一個工具。推薦大家多多了解以及實(shí)踐使用。這個偽類選擇符E:nth-child(n)的含義是匹配父元素的第n個子元素E。 例如:ul li:nth-child(3)表示的是選擇<ul>元素里面的第3個<li>。提示一下,該屬性在IE8(包含IE8)版本以下是不支持的。

建議開發(fā)童鞋使用跨平臺開發(fā)工具——統(tǒng)一開發(fā)環(huán)境UDE來進(jìn)行查看、調(diào)試、開發(fā)哦~~它是一款HTML5跨平臺一站式應(yīng)用開發(fā)、調(diào)試和部署工具, 支持HTML5跨平臺開發(fā),原Java跨平臺插件支持Android/Symbian/Kjava的跨平臺和原生開發(fā),為開發(fā)者提供豐富的應(yīng)用模板、示例代碼及開發(fā)者社區(qū)服務(wù),已覆蓋Android、iOS、WP、Symbian、Kjava操作系統(tǒng)平臺。

UDE模擬器調(diào)試效果圖
 

下面就一起來看看該示例的實(shí)現(xiàn)代碼吧。完整代碼下載請見附件。

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

復(fù)制代碼
代碼如下:

<div class="center">
<ul>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
</ul>
</div>

CSS樣式代碼

復(fù)制代碼
代碼如下:

@keyframes bump {
0% {
opacity: 0;
left: 535px;
}
100% {
left: -10px;
opacity: 0;
}
10%, 85% {
opacity: 1;
}
}
@keyframes spin {
0%, 100% {
height: 20px;
top: 50px;
}
50% {
height: 100px;
top: 0;
}
}
body {
background: rgba(0, 0, 0, 0.2);
}
div.center {
text-align: center;
margin-top: 40px;
}
ul {
background-color: rgba(255, 255, 255, 0.4);
position: relative;
display: block;
padding: 0;
margin: auto;
width: 600px;
height: 10px;
list-style: none;
border-radius: 200px;
border: 5px solid rgba(255, 255, 255, 0.2);
margin-top: 100px;
box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.1);
}
ul li {
position: absolute;
margin-top: -55px;
}
ul li:nth-child(1) {
animation: bump 1.5s infinite;
animation-delay: 0.1s;
}
ul li:nth-child(1) div {
border-radius: 22px;
transform-origin: center;
position: absolute;
height: 60px;
width: 80px;
animation: spin 0.4s infinite;
animation-delay: 0.1s;
background-color: rgba(120, 120, 120, 0.3);
}
ul li:nth-child(2) {
animation: bump 1.5s infinite;
animation-delay: 0.2s;
}
ul li:nth-child(2) div {
border-radius: 22px;
transform-origin: center;
position: absolute;
height: 60px;
width: 80px;
animation: spin 0.4s infinite;
animation-delay: 0.2s;
background-color: rgba(120, 0, 0, 0.3);
}
ul li:nth-child(3) {
animation: bump 1.5s infinite;
animation-delay: 0.3s;
}
ul li:nth-child(3) div {
border-radius: 22px;
transform-origin: center;
position: absolute;
height: 60px;
width: 80px;
animation: spin 0.4s infinite;
animation-delay: 0.3s;
background-color: rgba(120, 120, 0, 0.3);
}
ul li:nth-child(4) {
animation: bump 1.5s infinite;
animation-delay: 0.4s;
}
ul li:nth-child(4) div {
border-radius: 22px;
transform-origin: center;
position: absolute;
height: 60px;
width: 80px;
animation: spin 0.4s infinite;
animation-delay: 0.4s;
background-color: rgba(0, 120, 0, 0.3);
}
ul li:nth-child(5) {
animation: bump 1.5s infinite;
animation-delay: 0.5s;
}
ul li:nth-child(5) div {
border-radius: 22px;
transform-origin: center;
position: absolute;
height: 60px;
width: 80px;
animation: spin 0.4s infinite;
animation-delay: 0.5s;
background-color: rgba(0, 120, 120, 0.3);
}
ul li:nth-child(6) {
animation: bump 1.5s infinite;
animation-delay: 0.6s;
}
ul li:nth-child(6) div {
border-radius: 22px;
transform-origin: center;
position: absolute;
height: 60px;
width: 80px;
animation: spin 0.4s infinite;
animation-delay: 0.6s;
background-color: rgba(0, 0, 120, 0.3);
}
ul li:nth-child(7) {
animation: bump 1.5s infinite;
animation-delay: 0.7s;
}
ul li:nth-child(7) div {
border-radius: 22px;
transform-origin: center;
position: absolute;
height: 60px;
width: 80px;
animation: spin 0.4s infinite;
animation-delay: 0.7s;
background-color: rgba(120, 0, 120, 0.3);
}

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

源碼下載請見附件
 
閃爍跳躍進(jìn)度條.rar (1.6 KB)

相關(guān)文章

最新評論

新密市| 辉县市| 铜陵市| 德格县| 宜章县| 河西区| 南岸区| 固安县| 南乐县| 达州市| 台北县| 扎鲁特旗| 龙川县| 武山县| 永修县| 霍山县| 安阳县| 都昌县| 乌拉特中旗| 东阿县| 瓦房店市| 花莲市| 合作市| 东乡族自治县| 无极县| 宕昌县| 巧家县| 镇江市| 铜梁县| 洪泽县| 南郑县| 绥滨县| 北海市| 临夏县| 佳木斯市| 新竹县| 田东县| 盐池县| 昌黎县| 治多县| 安达市|