jquery实现照片堆叠悬浮散开动画效果代码

代码语言:html

所属分类:悬停

代码描述:jquery实现照片堆叠悬浮散开动画效果代码,悬浮某张照片可改变z-index。

代码标签: jquery 照片 堆叠 悬浮 散开 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


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

<head>

  <meta charset="UTF-8">
  

  
  
  
  
<style>
body {
  font-family: helvetica, arial, sans-serif;
  font-size: 12px;
  margin: 0;
  padding: 0;
}

.ps-container {
  display: flex;
  align-items: center;
  justify-items: center;
  width: 100wv;
  height: 100vh;
}

.ps-photoset {
  width: 60%;
  max-width: 400px;
  position: relative;
  margin: -80px auto 0;
  aspect-ratio: 7/5;
}

.ps-photoset:hover .ps-photo {
  transform: rotate(0deg);
}

.ps-photoset:hover .ps-photo:nth-child(1) {
  left: 15vw;
  top: 15vw;
}

.ps-photoset:hover .ps-photo:nth-child(2) {
  left: -15vw;
  top: 5vw;
}

.ps-photoset:hover .ps-photo:nth-child(3) {
  left: 5vw;
  top: -10vw;
}

.ps-photo {
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: 300ms all ease;
}

.ps-photo:nth-child(1) {
  transform: rotate(4deg);
}

.ps-photo:nth-child(2) {
  transform: rotate(3deg);
}

.ps-photo:nth-child(3) {
  transform: rotate(-3deg);
}

.ps-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 100wv;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  z-index: 999;
  background: rgba(255, 255, 255, 0.6);
}

.ps-controls .block {
  margin: 10px;
  display: inline-block;
}

.ps-controls .option-label {
  padding: 12px 10px 10px 0;
}

.ps-controls .option-label:hover {
  cursor: pointer;
}
</style>



</head>

<body >
  <article class="ps-container">
  <section class="ps-photoset"><img class="ps-photo" src="//repo.bfw.wiki/bfwrepo/image/62b2e607b3e4b.jpeg?x-oss-process=image/auto-orient,1/resize,m_fill,w_500,h_300,/quality,q_90"/><img class="ps-photo" src="//repo.bfw.wiki/bfwrepo/image/62b2e5dae4c6c.jpeg?x-oss-process=image/auto-orient,1/resize,m_fill,w_500,h_300,/quality,q_90"/><img class="ps-photo" src="//repo.bfw.wiki/bfwrepo/image/62b2e56f2d04a.jpeg?x-oss-process=image/auto-orient,1/resize,m_fill,w_500,h_300,/quality,q_90"/></section&.........完整代码请登录后点击上方下载按钮下载查看

网友评论0