开发者

jQuery tool tip not working when images added dynamically using ajax?

开发者 https://www.devze.com 2022-12-18 06:03 出处:网络
i am facing problem in jquery tool tip, when i am searching any image name and then loading ajax based search result in html then my tool tip is not working, even click event is not working.

i am facing problem in jquery tool tip, when i am searching any image name and then loading ajax based search result in html then my tool tip is not working, even click event is not working.

same functionality is working in defa开发者_运维百科ult image listing

can any one help me out?


You should use .live() instead of .bind(). Read 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.

0

精彩评论

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

关注公众号