0

Good morning!

I'm looking for a function which detects if all images are loaded. There are a few snippets on the internet with $("img").load(function(){...}) but I read that .load() was deprecated in jQ 1.8 . If not, it doesn't seem to work for me though :D

I'm currently developing in jQ 2.1.4 and using TYPO3 7.4, so the easiest way for me would be a custom jQ function which you can apply on all images. Thats why I didn't even try out the snippets where you add the src-attribute afterwards. Don't want to mess around in my TypoScript if not 100%ly necessary.

Thanks,
Norman

Norman
  • 785
  • 7
  • 27

1 Answers1

2

If you're concerned about the load method being deprecated, you could get away with using its synonymous form: $(window).on( "load", handler )

The load event fires when all images have been loaded.

Rick Viscomi
  • 8,180
  • 4
  • 35
  • 50