jQuery .html function with .load

I am loading HTML content using jQuery's `.html()` function. Part of the HTML content I am trying to load are images, which take some time to be loaded. What I do is on an onclick event, $('div').on('click',function() { $('html').fadeOut(1000) .html(content) .load(function() { $('html').fadeIn(1000) }); }); What I wanted to happen is that, when the DOM has finished loading, I want it to fadeIn. If it is still not finished, I want it to stay hidden hence, the fadeOut function before the html load. Is this possible? That method doesn't seem to work for me.

以上就是jQuery .html function with .load的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准