开发者

jQuery smooth image change

开发者 https://www.devze.com 2022-12-12 05:18 出处:网络
I wonder how to make image change i开发者_Go百科n my jQuery script smoother. I also have an animate() chain, can I attach the \"src\" change into it or not? Sadly I can\'t use images as CSS backgroun

I wonder how to make image change i开发者_Go百科n my jQuery script smoother.

I also have an animate() chain, can I attach the "src" change into it or not? Sadly I can't use images as CSS backgrounds...

Here's a little sample...

    function growBigger(element) {
    $(element)
        .find(".inside")
        .animate({ width: curWidth, height: curHeight, marginTop:"0px" })
        .end()
        .find(".label")
        .animate({ fontSize:curTitleSize })
        .end()

        $(element + " .inside .thumbnail").attr("src","images/big_" + curPanel + ".jpg")
}


Solved by preloading the images. Take a look at http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript

0

精彩评论

暂无评论...
验证码 换一张
取 消