gpt4 book ai didi

使用 ajax 动态添加图像时 jQuery 工具提示不起作用?

转载 作者:行者123 更新时间:2023-12-01 04:31:29 25 4
gpt4 key购买 nike

我在 jquery 工具提示中遇到问题,当我搜索任何图像名称,然后在 html 中加载基于 ajax 的搜索结果时,我的工具提示不起作用,甚至单击事件也不起作用。

默认图像列表中也有相同的功能

谁能帮帮我吗?

最佳答案

您应该使用 .live() 而不是 .bind()。阅读 this .

The .live() method is able to affect elements that have not yet been added to the DOM through the use of event delegation: a handler bound to an ancestor element is responsible for events that are triggered on its descendants. The handler passed to .live() is never bound to an element; instead, .live() binds a special handler to the root of the DOM tree.

关于使用 ajax 动态添加图像时 jQuery 工具提示不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2115805/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com