NUKnightLab / NUKnightLab/TimelineJS3

Preload images?

Open
#586 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
3.2k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

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 their src 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 to goToPrev(), but I still am seeing the grey "loading" square.

Is there some way to preload the images into whatever cache TimelineJS is using?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the backward timeline traversal with goToPrev() and inspect how TimelineJS requests and caches slide images. Compare browser-cached images with the grey loading state during rapid navigation. Done means establishing whether preloading can use TimelineJS's cache and documenting or implementing a reliable way to avoid the loading placeholder.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.