2

What's the best way to get the jquery ui icons to preload for rollover/hover etc...?

Rob
  • 10,004
  • 5
  • 61
  • 91

1 Answers1

1

This should do the trick:

    var img = new Image();
    img.src = '/themes/yourTheme/images/ui-icons_whatever.png';

Note that this is done asynchronously, so the rest of the page may load before the image(s) finish loading- but at least they will (probably) load before the user triggers a hover or other event.

Drew Gaynor
  • 8,292
  • 5
  • 40
  • 53