Ske*_*tor 4 jquery twitter-bootstrap jquery-ui-tooltip
我在同一元素上一起使用了引导程序确认和工具提示。我每个人都需要不同的内容。例如,一个可以使用confirm-title属性,另一个可以使用tooltip-title属性。现在,它们都使用html标记中的title属性。有没有办法更改默认值?
这是我所拥有的:jsfiddle
在此示例中,确认和工具提示都使用title属性。但是正如我所说,我希望他们使用两个不同的属性。
我知道我可以为每个使用两个不同的嵌套标签,例如:
<a href='#' title="text1" ...><span title="text2" ...> button </span></a>
Run Code Online (Sandbox Code Playgroud)
但是我正在寻找的是通过更改文本源来使用单个标签。
你可以这样做正是你想要使用什么工具提示标题和确认所有权。做这个:
HTML:
<a href="#Delete" class="btn btn-primary btn-large" tooltip-title="Tooltip title" confirm-title="Confirmation title" confirmation tooltip data-singleton="true" data-placement="top" data-popout="true">Click Me</a>
Run Code Online (Sandbox Code Playgroud)
JS:
// Uses 'tooltip-title' as title
$('a[tooltip]').tooltip({title: function() {
return $(this).attr("tooltip-title");
}});
// Uses 'confirm-title' attribute for title
$('a[confirmation]').confirmation({title: function() {
return $(this).attr("confirm-title");
}});
Run Code Online (Sandbox Code Playgroud)
演示:https : //jsfiddle.net/Drakes/wqccrujg/7/