您好,我在我的网站中使用Bootstraptour
,我想重写以下方法
Tooltip.prototype.fixTitle = function () {
var $e = this.$element
if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
}
}
你能解释一下如何覆盖这个吗?
如果我不编写此函数的代码,那么我的弹出窗口可以正常工作。它向我显示标题作为一个集合,如
{
element: '.modal-content .existing-attachments img:eq(2)',
placement: 'top',
title: _t("Select Cover"),
content: _t("Select the approprite cover."),
popover: { fixed: true },
},
但是由于此功能,它不会显示我在选项“选择封面
”中设置的标题,它会显示我想要设置弹出框的图像的标题。
<img class="img img-responsive" src="/website_blog/static/src/img/library/woodtexture.jpg" alt="Wood Wall Texture" title="Wood Wall Texture">
你能帮我吗?
最佳答案
您可以使用$.fn.tooltip.Constructor.prototype
访问Tooltip的所有原型(prototype)函数
关于jquery - 重写 bootstrap Tooltip.prototype.fixTitle() 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25913925/