简体   繁体   English

Twitter Bootstrap工具提示数据选择器?

[英]Twitter Bootstrap Tooltip Data-selector?

What is the data-selector option used for in Twitter's Bootstrap Tooltip ? Twitter的Bootstrap工具提示中使用的数据选择器选项是什么? The description reads... 描述为...

If a selector is provided, tooltip objects will be delegated to the specified targets.

But I don't understand its purpose or how to use it. 但是我不了解它的目的或用法。

It is the similar to using jQuery delegation methods like on() or delegate() in order to account for tooltip elements that aren't present in page when code is run. 这类似于使用诸如on()delegate()类的jQuery委托方法来解决代码运行时页面中不存在的工具提示元素。

Example binding to body since it is always present in page 绑定到body示例,因为它始终存在于页面中

$('body').tooltip({
   selector: '.mytooltipClass'

})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM