Insert object (jquery) delay?

前端 未结 6 478
天命终不由人
天命终不由人 2021-01-12 21:49

I allow the user to insert an object, an image, and then i call a function on that object. What seems randomly to me, sometimes it works and sometimes not, I guess it has t

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-12 22:49

    u can use load function of jquery. Here is an example with your code:

    http://jsfiddle.net/UhUb7/

        var images = [
        "http://upload.wikimedia.org/wikipedia/commons/4/4b/Apple_pie.jpg"
                 ]
    
    $(document).ready(function(){
        addImage(images[0]);
    });
    
    function addImage(url){
        var holder = $('

提交回复
热议问题