我正在实施表格中单元格的工具提示,我需要能够抓取目标的data-message
属性。jQuery工具:工具提示,jQuery引用“this”属性
$("#pricing_plans_table .sku_tooltip").tooltip({
// each trashcan image works as a trigger
tip: '#' + $(this).attr('data-message'),
// move tooltip a little bit to the right
offset: [0, 15],
// there is no delay when the mouse is moved away from the trigger
delay: 0
});
这是行不通的。我得到“找不到[对象对象]的工具提示”...我不太清楚如何正确引用目标。
这一切都看起来是正确的,我们可以看到html以及? –
console.log'$(this).attr('data-message')' – CamelCamelCamel