New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preload images? #586
Comments
It appears there is an intentional delay showing the image to show that "loading" animation. I don't know if there is an official way to avoid that, but here is an unofficial way that accomplishes what I think you are after - it accesses undocumented stuff so it may break when a new version is released. Instead of pre-loading the images the way you are doing now, do: |
That does seem to do the trick for everything except the last slide (which is the first shown since I am trying to start at the end and flip backwards), which is still subject to the 1200ms delay in the However I find that I'm also hemmed in by the slide transition animation duration. It seems as if I call And if I preload the images and call @fastfasterfastest thanks for the suggestion! That definitely solves part of the problem. I will keep poking around to see if I can make it work somehow. |
For the last slide (the first one you show) you could delay showing it (i.e. navigating to it) until after its media has been loaded - it would still be a delay but not at that slide. You could e.g. display something else instead of the timeline in the meantime. For the slide transition animation, doesn't |
Yeah, I'll have to figure out my own "Loading..." animation for the beginning. But yes, you're right, Then when I reach the title slide, I reset everything by resetting the default values in Very cool. Thanks very much, @fastfasterfastest ! |
👍 |
If it is ever going to be public, it won't be until next year. It's for a touchscreen kiosk that's going in a visitor's center, and they may eventually add it to their public web site. But, since it's not going to be public for a while, I can post the code here. Keep in mind I only have 21 slides (including the title slide), so if you have more or less, you may need to play with some of the timing numbers. Also, this is in a React component, so I'm using ES6 style code. And I'm not including any code to handle showing a custom loading screen to hide the loading of the last slide (as discussed in the posts above), this is just to get the flipping back through time effect:
|
I'm trying to create a Marvel-movie-intro-like effect by starting the timeline at the end, and then successively calling
goToPrev()
with a short delay between calls, to quickly flip backwards through all the slides.That all works, but I don't see the images, I only see the grey "loading" square.
I tried to preload the images into the browser cache by using the technique here:
https://stackoverflow.com/a/901699/988264
whereby you just create a bunch of
Image()
objects and set theirsrc
property. That seems to work fine, if I look at my browser tools network tab while the page is loading, it looks like all the images load before the first call togoToPrev()
, but I still am seeing the grey "loading" square.Is there some way to preload the images into whatever cache TimelineJS is using?
The text was updated successfully, but these errors were encountered: