我正在使用 jQuery Tools 工具提示插件,该插件是使用 $('selector').tooltip()
初始化的。我想在任何当前或 future 的 .tooltipper
元素上调用它。我认为以下方法可行:
$('.tooltipper').live('ready', function(){
$(this).tooltip()
}
但它不成功——就绪事件没有触发。负载也一样。我读过 livequery 可以产生我正在寻找的结果,但考虑到文档说它适用于,肯定有一种方法可以使用 jQuery .live()
来实现它所有 jQuery 事件,我相信 ready
就是其中之一。
最佳答案
引用自 jQ API (http://api.jquery.com/live/):
In jQuery 1.3.x only the following JavaScript events (in addition to custom events) could be bound with .live(): click, dblclick, keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover, and mouseup.
As of jQuery 1.4 the .live() method supports custom events as well as all JavaScript events.
As of jQuery 1.4.1 even focus and blur work with live (mapping to the more appropriate, bubbling, events focusin and focusout).
As of jQuery 1.4.1 the hover event can be specified (mapping to "mouseenter mouseleave").
.live()
似乎不支持就绪事件。
关于dom - jQuery 实时处理就绪或加载事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3196404/