简体   繁体   English

在sencha-touch中为jquery过渡预加载css-background-images

[英]preload css-background-images for jquery transition in sencha-touch

in my sencha-touch appp I have a jquery animation of the backbround-images via CSS-transition. 在我的sencha-touch appp中,我通过CSS转换获得了backbround-images的jquery动画。 the problem is that the fades to the next images doesn't work unit every image has been fully loaded once. 问题是,对于下一个图像的淡入淡出不起作用,每个图像都已完全加载一次。 so the first round of the slideshow isn't smootly changig. 所以第一轮幻灯片放映并不是一成不变的。

is there any way to preload the images used as css-background-images? 有没有办法预加载用作css-background-images的图像? thnx! 日Thnx!

In jQuery you can use something like this to preload images: 在jQuery中,您可以使用类似的东西来预加载图像:

$('<img/>').attr('src', 'image.png').load(function() {
//... do stuff.
});

Edit: Here is the function reference: .load() 编辑:这是函数引用: .load()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM