JS/jQuery 中的缩放幻灯片
在当前的项目中,我们希望在起始页上播放幻灯片,稳定地循环浏览图像。到目前为止,一切都很好。
但客户还要求在转换之间缓慢缩放图像。它在 Flash 中可用,并且已经使用了相当长一段时间,示例如下链接:
http: //activeden.net/item/xml-zooming-slideshow/9577
但我想在 JS/jQuery 中实现这个。有谁知道有一个插件可以做到这一点,或者之前写过一个插件可以帮助我们开始了?
感谢所有帮助!
此致 尼克拉斯
On a current project, we want a slideshow on the start page, cycling through the images on a steady pase. So far so good.
But the customer requests a slow zoom on the images between the transitions as well. It's available in Flash and has been used for quite some time, example on the link below:
http://activeden.net/item/xml-zooming-slideshow/9577
But I want this in JS/jQuery.. Does anyone know of a plugin that will do this, or has written one before that could get us started?
All help appreciated!
Best regards
Niclas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这就是所谓的“肯·伯恩斯效应”。
请参阅:http://tobia.github.com/CrossSlide/
我不建议使用任何此效果的 JavaScript 实现 - 它们在某些浏览器中都会出现令人不愉快的“摆动”。
That's called the "Ken Burns effect".
See: http://tobia.github.com/CrossSlide/
I don't recommend using any JavaScript implementation of this effect - they all appear to "wobble" unpleasantly in certain browsers.
我希望这会对您有所帮助
http://andreaslagerkvist.com/jquery/image-zoom/
I hope this will help you
http://andreaslagerkvist.com/jquery/image-zoom/
我认为 javascript/jquery 路线是错误的方法。 CSS 是一个更好的方法。我改编了在此页面找到的解决方案: https://www.cssscript.com/pure-css-css3-slideshow-with-image-panning-and-zooming-effect/#:~:text=A%20pure%20HTML%20/%20CSS% 20background%20slideshow
并在我的 React SPA 中使用了它。效果真的很好。
我的 CSS(在您的 tsx 文件中导入 './screensaver.css' //)
然后在组件内部(根据您的文件类型进行调整):
I think the javascript/jquery route is the wrong way to go for this. CSS is a better way. I adapted the solution found at this page: https://www.cssscript.com/pure-css-css3-slideshow-with-image-panning-and-zooming-effect/#:~:text=A%20pure%20HTML%20/%20CSS%20background%20slideshow
And used it in my React SPA. It works really well.
My CSS (import './screensaver.css' // in your tsx file)
Then inside the component (adjust for your kind of files):