Full screen slider with zoom in/out transition effect(具有放大/缩小过渡效果的全屏滑块)
问题描述
我的意思是这样的.如何使用 GSAP、Transit 或 VelocityJS 等库获得该结果?
I mean something like this. How can I obtain that result with a library like GSAP, Transit or VelocityJS?
http://www.echocapital.com/
提前致谢:)
推荐答案
不知道 GSAP 和 Velocity
因为你只需要一点 CSS 和一些 JS 或 jQuery,我的意思是你可以用 vanilla JS 轻松地重写以下内容:
Dunno about GSAP and Velocity
Cause all you need is a bit of CSS and some JS or jQuery, I mean you can rewrite easily the below in vanilla JS:
var $gal = $("#gallery"), $img = $gal.find("> div"),
n = $img.length, i = 0, t;
$img.eq(i).addClass('on');
(function loop() {
t = setTimeout(function(){
$img.removeClass("on").eq(i++%n).addClass("on");
loop();
}, 3000);
}());
*{margin:0;}
html, body{height:100%;background:#444;}
#gallery{
overflow:hidden;
}
#gallery,
#gallery > div{
position:absolute;
top:0; left:0; bottom:0;right:0;
}
#gallery > div{
background: none 50% / cover;
transform:scale(0.94);
transition:0.8s;
opacity: 0;
}
#gallery > div.on{
transition-delay: 0.1s;
transform:scale(1);
opacity: 1;
}
<script src="aHR0cHM6Ly9hamF4Lmdvb2dsZWFwaXMuY29tL2FqYXgvbGlicy9qcXVlcnkvMi4xLjEvanF1ZXJ5Lm1pbi5qcw=="></script>
<div id="gallery">
<div style="background-image:url(//placehold.it/800x600/daa&text=1)"></div>
<div style="background-image:url(//placehold.it/800x600/dad&text=2)"></div>
<div style="background-image:url(//placehold.it/800x600/ada&text=3)"></div>
</div>
这篇关于具有放大/缩小过渡效果的全屏滑块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:具有放大/缩小过渡效果的全屏滑块


- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01