0

I incorporated the arrowChecker script for navigating between a series of webpages. Each page include an image. It works well except that I found that with arrowChecker included, the image loads very much more slowly. Presumably the browser is busy checking for keypresses instead of getting on with loading the image.

Any suggestions?

I was expecting the page to behave much the same with and without arrow checker. It didn't - image loading was much slower.

  • 1
    Can you give us an example of your code or a [mwe](https://stackoverflow.com/help/minimal-reproducible-example) – async await Jan 12 '23 at 00:29
  • Here is the code (next message). It is not very fancy. You can navigate to other pages by clicking on labels or using arrow keys. Obviously, this code alone is not going to work as it needs image files and the other pages to which it refers. If you want to see it working in context (but without the arrow keys, go to https://ronduggleby.com/photos/myfiles/CHAR1/CHAR_00070.html – ron duggleby Jan 13 '23 at 02:38
  • I don't know how to send the code. I get the message "Too long by 1394 characters" – ron duggleby Jan 13 '23 at 02:42
  • Ok, here's how I'll do it. Follow this link. https://ronduggleby.com/photos/myfiles/CHAR1/CHAR_00070a.html. You can look at the source code there. I have only changed this one page - other pages will not have arrow keys. – ron duggleby Jan 13 '23 at 04:54
  • As a formal, StackOverflow response: Your question does not clearly recreate the issue, however after looking at the links in your comments and making a few assumptions, your question is "Does having an event listener cause images to load slower on page change", to which I would say, no it does not. JS, being event based, will not be "busy checking for keypresses" with the way you have implemented the key navigation. If you question is, "how can I make the images load faster" [this might help](https://stackoverflow.com/a/30390377/7978627) – async await Jan 15 '23 at 01:07
  • As an informal comment just talking to you, dear Ron Duggleby :) I'd ask, what is the goal of making this website? If you're just trying to make a hobby project to share with friends, I'd recommend checking out wordpress or something like wix. They are robust website no-code editors, often with free options. They will handle optimization for you. If you want to learn more about web technology and this is a way for you to do this, I would suggest implementing a carousel library like [glide.js](https://glidejs.com/docs/setup/) [youtube tutorial](https://www.youtube.com/watch?v=kpAt25cOBrU) – async await Jan 15 '23 at 01:18
  • The goal is to make a photo album that can be accessed by friends. I have tried several off-the-shelf album makers and not one of them does exactly what I want. In the end, I wrote my own code. I know it is crude. I first started writing HTML in the 1990s and never really got past the basics. What I have works fine, does what I want and I can generate all the webpages and image files with some fairly simple scripts. – ron duggleby Jan 16 '23 at 02:57
  • I thought it would be nice to navigate using arrow keys and found a script that would do it. Unfortunately, loading images was much slower. I do not know why this was. But it made the album unfriendly - nobody wants to wait even a few seconds for an image to load when an album may contain hundreds of pictures. – ron duggleby Jan 16 '23 at 02:59
  • I did look at glide.js. It may seem simple to you but it all looked a bit ad hoc to me. So I think I'll stay with what I have and not bother with arrow key navigation. But thanks for taking an interest in this problem. – ron duggleby Jan 16 '23 at 03:01
  • I'd check out google photos for making a photo album that can be accessed by friends! It's super useful for making albums and sharing them! You could always use google drive too :) I wish you the best either way! – async await Jan 16 '23 at 06:37
  • Seriously? Google photos is not very useful. If you want to organise photos in any order other than by date taken you are out of luck. And adding captions is not at all easy. – ron duggleby Jan 17 '23 at 07:26
  • Yes, seriously. The skill barrier and ease of use / load time using something like google photos would be easier considering you're expressing concern using something like glidejs. You could add descriptions to photos and even organize specific slideshows for people to see. If you wanted more custom organization or even add effects/filters to photos you could always use google slides. Not discouraging you from your current course, just letting you know. I wish you the best regardless [There's hundreds of options](https://www.google.com/search?q=how+to+create+a+virtual+photoalbum) – async await Jan 18 '23 at 20:09

0 Answers0