简体   繁体   English

如何打造旋转瓶效果?

[英]How to create the rotating bottle effect?

I just wanted to ask for an advice on how the effect with the rotating bottle on scroll is done so smooth on this website: https://takeboost.com/ Is this an svg file or is it frames that are loaded upon scroll?我只是想在这个网站上就滚动旋转瓶子的效果如何如此流畅地征求意见: https://takeboost.com/这是一个 svg 文件还是滚动时加载的框架?

Thank you in advance!先感谢您!

Using F12 > Network and refreshing the page, we can see 299 .jpg are loaded by JavaScript, these images are then drawn to a canvas when scrolling.使用F12 > Network并刷新页面,我们可以看到 JavaScript 加载了 299 个.jpg ,然后滚动时将这些图像绘制到canvas上。

You can also use F12 > Network to find related JavaScript code:您也可以使用F12 > Network查找相关的 JavaScript 代码:

  1. Hover on the Initiator column of these image requests in F12 > Network Hover 在F12 > Network中这些图像请求的Initiator列上
  2. Click first clickable js link单击第一个可点击的 js 链接
  3. Click "Pretty-print", the code to load these images will be highlighted.单击“Pretty-print”,加载这些图像的代码将突出显示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM