Observer+gsap实现图片上下切换幻灯片效果代码
代码语言:html
所属分类:幻灯片
代码描述:Observer+gsap实现图片上下切换幻灯片效果代码
代码标签: Observer gsap 图片 上下 切换 幻灯片
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { margin: 0; padding: 0; box-sizing: border-box; } .wrapper { width: 100%; height: 100vh; background-color: black; } .slider { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; } .content { width: 60%; min-width: 400px; height: 400px; border: 1px solid red; overflow: hidden; position: relative; } .content .slide { width: 100%; height: 100%; position: absolute; top: 0; left: 0; } .content .slide img { position: relative; height: 100%; width: 100%; object-fit: cover; clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%); } .content .slide:first-child img { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); } </style> </head> <body translate="no"> <div class="wrapper"> <div class="slider"> <div class="content"> <div class="slide"> <img src="//repo.bfw.wiki/bfwrepo/image/5e62ef20b92ee.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_800,h_400,/quality,q_90" alt=""> </div> <div class="slide"> <img src="//repo.bfw.wiki/bfwrepo/image/5e62ef60656fd.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_800,h_400,/quality,q_90" alt=""> </div> <div class="slide"> <img src="//repo.bfw.wiki/bfwrepo/image/607d718558628.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_800,h_400,/quality,q_90" alt=""> </div> .........完整代码请登录后点击上方下载按钮下载查看
网友评论0