twitter-bootstrap – Twitter Bootstrap工具提示:是否有可能避免编写javascript?

我注意到在使用Bootstrap的 Tooltip时,我仍然需要在javascript文件中手动包含此行以使其工作:
$('[rel="tooltip"]').tooltip();​

但是,引用documentation

You can use all Bootstrap plugins purely through the markup API
without writing a single line of JavaScript. This is Bootstrap’s first
class API and should be your first consideration when using a plugin.

但这不是我所看到的:http://jsfiddle.net/ccmyx/1/(尝试删除Javascript部分).

我错过了什么吗?

解决方法

不,与所有其他JavaScript组件相反,Tooltip和Popover都不支持data-api.这在 documentation中提到:

For performance reasons,the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.

相关文章

Bootstrip HTML 查询搜索常用格式模版 <form class=&...
如何在按钮上加红色数字 您可以使用Bootstrap的badge组件来在...
要让两个按钮左右排列,你可以使用 Bootstrap 的网格系统将它...
是的,可以将status设置为布尔类型,这样可以在前端使用复选...
前端工程师一般用的是Bootstrap的框架而不是样式,样式一般自...
起步导入:<linkrel="stylesheet"href="b...