gpt4 book ai didi

jquery - 重写 bootstrap Tooltip.prototype.fixTitle() 方法

转载 作者:行者123 更新时间:2023-12-01 07:54:18 26 4
gpt4 key购买 nike

您好,我在我的网站中使用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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com