这是我用于保持打开工具提示而不悬停或点击的示例 但它没有任何其他建议
NSMutableArray *dataFileArray = [NSMutableArray new];
// getAddressBook
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef results = ABAddressBookCopyArrayOfAllPeople(addressBook);
NSInteger resultsCount = CFArrayGetCount(results);
for(int i = 0; i < resultsCount; i++) {
NSString *book;
ABRecordRef person = CFArrayGetValueAtIndex(results, i);
ABMutableMultiValueRef name = ABRecordCopyCompositeName(person);
ABMutableMultiValueRef phone = ABRecordCopyValue(person, kABPersonPhoneProperty);
NSMutableArray *phoneArray = [NSMutableArray new];
NSInteger index = ABMultiValueGetCount(phone);
for (int k = 0; k < index; k++) {
CFStringRef phoneRef = ABMultiValueCopyValueAtIndex(phone, k);
[phoneArray addObject:(__bridge NSString *)(phoneRef)];
CFRelease(phoneRef);
}
book = [NSString stringWithFormat:@"%@:%@", name, [phoneArray componentsJoinedByString:@","]];
CFRelease(phone);
CFRelease(name);
[dataFileArray addObject:book]; //here is AddressBookPage.m:92
}
CFRelease(results);
CFRelease(addressBook);
我的jquery for tooltip保持活跃
dataType: json,
$('#address').val(data.address);
$('#phone').val(data.phone);
答案 0 :(得分:6)
尝试添加
data-toggle="tooltip" data-placement="right"
到你的html:
<a href="#" data-toggle="tooltip" data-placement="right" title="Download Excel" class="tool_tip">Download Excel</a>
https://jsfiddle.net/404c3fxb/
或者,您可以使用jQuery,对于您想要的所有元素,使用类选择器:
$('.tool_tip')
.attr('data-toggle', 'tooltip')
.attr('data-placement', 'right')
.tooltip({
trigger: 'manual'
})
.tooltip('show');
https://jsfiddle.net/404c3fxb/1/
数据展示位置是工具提示位置(左,上,下或右)。
答案 1 :(得分:0)
Bootstrap 4.x - JS
$('#IDENTIFIER').css({'pointer-events': 'none'}).tooltip('show');
Bootstrap 4.x - CSS
#IDENTIFIER# { pointer-events: none; }
这样,(工具提示的)父元素将忽略所有点击事件 - 因此工具提示始终可见。