Hey guys, on my website (right now just a testing ground for features for the actual website) I’m working on a feature where, as the user scrolls down, a series of images scrolls through, replicating a video. I know there is a way to replicate this with HTML5 video but the quality is much lower. I already have this feature working on the site. HERE is the published version. Very rough around the edges but it gets the point across. Here’s where the problem comes in: I refer to the images in an embed widget in this format:
which works fine for a few frames but I’m trying to implement a video with 500 frames, and that’s way too much code for WebFlow to take. Is there a way to host an image source list somewhere else and iterate through it from WebFlow? Thanks guys.
The main drawback: Every time you need to update the code outside of Webflow.
iterate most of the time its by JSON & JS to HTML (Another topic). On webflow you only put the custom code (Your idea should work first on codepen or regular html).
Thank you so much for your reply! I really appreciate it. I already have the file hosted HERE but my problem is that I am using an embed widget to function as the collection of images but when I use the script: <script type=“text/javascript” src=“http://yourjavascript.com/1101112308/scroll1.js”></script> it doesn’t recognize it as an image. However, if I paste the lines of code into the embed widget, the site works perfectly (but the code is too long). It seems like the solution you gave doesn’t really solve the problem unless I hosted ALL the code referring to the list of images in a .js file. If I do that, will I still be able to match the images to the location of the embed widget?
First of all I just want to thank you for your in-depth responses. Your help is greatly appreciated and I have learned a lot. I’m so close to getting this to work but I’m not very experienced with troubleshooting JavaScript and there’s a small problem.
After I implemented everything, the data div displays all the images at once in a long line as if it were one string instead of iterating through each image. Is there something wrong with my code? Did I not change it enough to work with the changes of the new code?
I’m so close to making this work, thank you again for all your help.
You’re right, it takes forever to load. I was thinking I could use a lower quality image but it might just be better to use an HTML5 video to scroll through and accept the lower quality.
This is the codepen I based my code off of. I’ve been trying to make the new code work on CodePen for the past hour and still can’t figure out what the issue is. Even when I add line breaks so there are 17 separate image sources, the function doesn’t want to iterate through them.
Thanks you!!! The problem was that I was using $(#‘data’) instead of $(#‘data img’) inside of the function. Thank you for the suggestion of the HTML5 video, I’ve already implemented it on a different version of the site to test it out but it skips frames and lags behind if the quality goes above 480p. I’ll try using more compressed images with this version so it will take much less time to load.