duanqiongdu9916 2019-07-18 08:39
浏览 130

有没有办法在ajax调用后用js改变图像的背景?

I have a page that creates a 36 page book with php, ant then shows it to the user using a flipbook.js. Since the book is so big, the page takes a long time to load (something like 15 seconds), so I thought make the page create only 5 book pages, and then creating the rest using ajax so that the user doesn't wait too much. The problem is that when i create the other pages and i try to change the background using jquery on the ajax.success function the page doesn't show the images.

If i do this with normal images using the src instead of the background it works.

Can anybody help me find a way?

thanks.

  • 写回答

1条回答 默认 最新

  • duandianzhong8315 2019-07-18 09:03
    关注

    why don't you just add the normal images by jquery on ajax success if that's been working for you?

    a simple idea of how to add src to an image would be:

    $('image_selector').attr('src', $src);
    

    Makes sense?

    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记