我最近一直在使用JQuery UI工具提示,并且有不错的经验。出现问题的地方是它不更新悬停元素的title属性(在某些情况下)。更奇怪的是,这适用于除某些元素之外的所有悬停元素。它们也都由其ID唯一标识。但是JQuery UI只是响应式的,不会执行所需的操作。
我尝试使用工具提示“内容”选项的变体,但它似乎不起作用。行为是相同的,没有任何变化。我尝试解决这个问题的方法越多,我意识到要做的事情就越少。
open: function(event, ui) {
var id = this.id;
console.log(id);
console.log(metaService);
for (var i = 0; i < metaService.features.length - 1; i++) {
if (metaService.features[i].properties.col_name === id) {
console.log("Yes There is a match!");
console.log("This is the Column name" + metaService.features[i].properties.col_name + "check.");
console.log("This is the Header ID" + id)
console.log(metaService.features[i].properties.descriptn);
console.log(metaService.features[i].properties.info_url);
if (metaService.features[i].properties.info_url == '') {
var urlMessage = "";
$("#" + id).tooltip().tooltip({
'content': metaService.features[i].properties.descriptn
});
console.log(metaService.features[i].properties.descriptn);
console.log("In the IF")
} else {
var urlMessage = " Read More about the Column name <a href=" + metaService.features[i].properties.info_url + " target='_blank'> <b><u>here</u></b></a>"
$("#" + id).tooltip().tooltip('option', 'content', metaService.features[i].properties.descriptn + urlMessage);
console.log("In the ELSE")
}
} else {
console.log("YAY!")
}
}
},