怎么在HTML5中實(shí)現(xiàn)一個(gè)3D旋轉(zhuǎn)相冊(cè)

今天就跟大家聊聊有關(guān)怎么在HTML5中實(shí)現(xiàn)一個(gè)3D旋轉(zhuǎn)相冊(cè),可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

十載的鎮(zhèn)康網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。營(yíng)銷型網(wǎng)站的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整鎮(zhèn)康建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)建站從事“鎮(zhèn)康網(wǎng)站設(shè)計(jì)”,“鎮(zhèn)康網(wǎng)站推廣”以來(lái),每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。

HTML5 代碼如下:

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>HTML5 3D旋轉(zhuǎn)圖片相冊(cè) 可鼠標(biāo)懸停</title>
<style text="text/css">
* {
padding: 0;
margin: 0;
border: none;
outline: none;
box-sizing: border-box;
}

*:before,
*:after {
box-sizing: border-box;
}

html,
body {
min-height: 100%;
}

body {
background-image: radial-gradient(mintcream 0%, lightgray 100%);
;
}

.Container {
margin: 4% auto;
width: 210px;
height: 140px;
position: relative;
perspective: 1000px;
}

#carousel {
width: 100%;
height: 100%;
position: absolute;
transform-style: preserve-3d;
animation: rotation 20s infinite linear;
}

#carousel:hover {
animation-play-state: paused;
}

#carousel figure {
display: block;
position: absolute;
width: 220px;
height: 120px;
left: 10px;
top: 10px;
background: black;
overflow: hidden;
border: solid 5px black;
}

img {
filter: grayscale(1);
cursor: pointer;
transition: all 0.3s ease 0s;
width: 100%;
height: 100%;
}

img:hover {
filter: grayscale(0);
transform: scale(1.2, 1.2);
}

#carousel figure:nth-child(1) {
transform: rotateY(0deg) translateZ(288px);
}

#carousel figure:nth-child(2) {
transform: rotateY(60deg) translateZ(288px);
}

#carousel figure:nth-child(3) {
transform: rotateY(120deg) translateZ(288px);
}

#carousel figure:nth-child(4) {
transform: rotateY(180deg) translateZ(288px);
}

#carousel figure:nth-child(5) {
transform: rotateY(240deg) translateZ(288px);
}

#carousel figure:nth-child(6) {
transform: rotateY(300deg) translateZ(288px);
}

@keyframes rotation {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
}
</style>
</head>

<body>
<div class="Container">
<div id="carousel">
<figure><img src="img/1.jpg" alt=""></figure>
<figure><img src="img/2.jpg" alt=""></figure>
<figure><img src="img/3.jpg" alt=""></figure>
<figure><img src="img/4.jpg" alt=""></figure>
<figure><img src="img/5.jpg" alt=""></figure>
<figure><img src="img/6.jpg" alt=""></figure>
</div>
</div>
</body>

</html>

看完上述內(nèi)容,你們對(duì)怎么在HTML5中實(shí)現(xiàn)一個(gè)3D旋轉(zhuǎn)相冊(cè)有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。

分享文章:怎么在HTML5中實(shí)現(xiàn)一個(gè)3D旋轉(zhuǎn)相冊(cè)
標(biāo)題網(wǎng)址:http://www.muchs.cn/article28/ghgejp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站設(shè)計(jì)公司網(wǎng)站排名、動(dòng)態(tài)網(wǎng)站、關(guān)鍵詞優(yōu)化、移動(dòng)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化