Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
让 jquery ui 图标预加载以进行翻转/悬停等的最佳方法是什么......?
这应该可以解决问题:
var img = new Image(); img.src = '/themes/yourTheme/images/ui-icons_whatever.png';
请注意,这是异步完成的,因此页面的其余部分可能会在图像完成加载之前加载 - 但至少它们会(可能)在用户触发悬停或其他事件之前加载。