quick JS question

  • Started
  • Last post
  • 1 Response
  • bry

    been trying to figure this out since different browsers/machines have been giving me different results..

    if you have a javascript imageswap thing going on for a given page, but the images used for each state are already being used elsewhere in the page regardless (and thus are already loaded), does this make a JS preloader for those images irrelevant? (btw, i only have 2 images that toggle between each other at onClick)

    i'm asking because on one computer the swap happens instantaneously but the other one (faster one in fact) is giving me a 1/4-second lag before the imageswap actually happens. would a preloader make it faster or would it have no effect?

  • unknown0

    did you tried and tested it with a js preloader to check if it would fix the problem?

    did you empty the cache first?

    depends on the code. are those images defined in the same way?

    generally i would use a js preloader. wouldn't take any longer if it's already loaded and in the cache but from a coding point of view it's cleaner coding.