简体   繁体   中英

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. 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? thnx!

In jQuery you can use something like this to preload images:

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

Edit: Here is the function reference: .load()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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