英文:
Show info stored in table td on hover or click
问题
以下是已翻译的内容:
$('.shippingrates td').hover(function(){
$(this).attr('data-id');
});
英文:
What would be the easiest way to show info stored in each table cell data-id on hover or click (mobile device). I'm not sure how it works on mobile devices.
$('.shippingrates td').hover(function() {
$(this).attr('data-id');
});
答案1
得分: 1
一个实现“hover”对话框的简单方法是使用Bootstrap的“popover”库。
https://getbootstrap.com/docs/4.0/components/popovers/
JS
$(function () {
$('[data-toggle="popover"]').popover()
});
HTML
<button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">底部弹出框</button>
英文:
An easy way to implement hover
dialogs would be to use the bootstrap popover
library.
https://getbootstrap.com/docs/4.0/components/popovers/
JS
$(function () {
$('[data-toggle="popover"]').popover()
});
HTML
<button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">Popover on bottom</button>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论