html+css3+jquery实现3D立体图片列排列

 时间:2026-02-16 14:42:51

1、准备好需要用到的图标。

html+css3+jquery实现3D立体图片列排列

html+css3+jquery实现3D立体图片列排列

2、新建html文档。

html+css3+jquery实现3D立体图片列排列

3、书写hmtl代码。

<div class="blocks">

  <div class="block">

    <div class="overlay"> <img src="img/con.png"  /> <良巨/div>

    <img src="img/overs.jpg" alt="Image" /> </div>

  <div class="block">

    <div class="overlay"> <img src="img/con.png" /> </div>

    <img src="img/st.jpg" alt="Image" /> </div>

  <div class="毙互block">

    <div class="overlay"> <img src="img/on.png" /> </div>

   冲况艳 <img src="img/rter.jpg" alt="Image" /> </div>

  <div class="block">

    <div class="overlay"> <img src="img/con.png" /> </div>

    <img src="img/work.jpg" alt="Image" /> </div>

</div>

html+css3+jquery实现3D立体图片列排列

4、书写css代码。

html { height: 100%; width: 100%; }

body { background: #eee linear-gradient(135deg, #2980b9, #9b59b6); display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; height: 100%; width: 100; }

body .blocks { position: relative; display: -box; display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; }

body .blocks .block { position: relative; display: block; width: 200px; height: 200px; margin: 20px; transform: perspective(600px) rotateY(-30deg); transition: transform .3s; transition: transform .3s, -transform .3s; }

body .blocks .block img { width: auto; max-width: 100%; }

body .blocks .block .overlay { position: fixed; display: -ms-flexbox; display: flex; -box-align: center; -ms-flex-align: center; align-items: center; -box-pack: center; -ms-flex-pack: center; justify-content: center; top: 0; right: 0; bottom: 0; left: 0; z-index: 2; background-color: rgba(0, 0, 0, 0.5); opacity: 0; -transition: opacity .3s ease; transition: opacity .3s ease; }

body .blocks .block .overlay img { width: auto; max-width: 50%; }

body .blocks .block.hover, body .blocks .block:hover { -transform: rotateY(0); transform: rotateY(0); cursor: pointer; }

body .blocks .block.hover .overlay, body .blocks .block:hover .overlay { opacity: 1; }

html+css3+jquery实现3D立体图片列排列

5、书写并添加js代码。

<script src="js/jquery-1.11.0.min.js"></script> 

<script>

$(document).ready(function() {

 var count = 0;

 var blocks = $(".block");

 var testEffect = setInterval(function() {

$(blocks[count - 1]).removeClass("hover");

$(blocks[count]).addClass("hover");

count++;

if (count > 4) clearInterval(testEffect);

 }, 800);

});

</script>

html+css3+jquery实现3D立体图片列排列

6、代码整体结构。

html+css3+jquery实现3D立体图片列排列

7、查看效果。

html+css3+jquery实现3D立体图片列排列

  • MySQL数据库字符集怎么查看你
  • PowerDesigner中同时显示字段和字段名称
  • C#----将图片插入数据库
  • WAS静默方式更新补丁
  • 如何使用exe程序文件安装Smartbi
  • 热门搜索
    农家小炒肉的做法 羊汤的做法大全 剪映怎么去水印 海参的做法 胡辣汤的做法 麻将怎么打 豆角的做法大全家常 苓怎么读 歆怎么读 燃面的做法