我正在使用 .tooltip 对整个页面中的每个进行简单描述。除了页面的标题名称(不仅仅是图标和菜单)显示在屏幕的左下角之外,它对所有内容都非常有用。如何仅对以“step”开头的标题标签进行异常(exception)处理?谢谢。
$.widget( "ui.tooltip", {
version: "1.9.2",
options: {
content: function() {
return $( this ).attr( "title" );
},
hide: true,
// Disabled elements have inconsistent behavior across browsers (#8661)
items: "[title]:not([disabled])",
position: {
my: "left top+15",
at: "left bottom",
collision: "flipfit flip"
},
show: true,
tooltipClass: null,
track: false,
// callbacks
close: null,
open: null
},
最佳答案
只需为您的 items
定义使用普通的 jquery 选择器:
items: '[title^="step"]:not([disabled])',
应该可以解决问题,要获得更多选择器的乐趣,请参阅 jquery selector documentation
@编辑: 我刚刚重新阅读了您的问题,要排除标题开头带有“步骤”一词的项目,请使用:
items: '[title]:not([disabled]):not([title^="step"])',
关于jquery-ui - jQuery : How to disable/make exception for only one tag?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13746572/