Twitter bootstrap 如何在引导工具提示中创建链接

Twitter bootstrap 如何在引导工具提示中创建链接,twitter-bootstrap,tooltip,Twitter Bootstrap,Tooltip,我使用了Visual Studio 2013并制作了Web项目(使用C#MVC5)。我添加了bootstrap toltip $("a").tooltip({ animated: 'fade', placement: 'right', html: true, delay: { show: 750, hide: 100 }, }); }); 和标题代码 <td style="width:200px;"> <a href="@Url.Act

我使用了Visual Studio 2013并制作了Web项目(使用C#MVC5)。我添加了bootstrap toltip

$("a").tooltip({    
    animated: 'fade',
    placement: 'right',
    html: true,
    delay: { show: 750, hide: 100 },
});
});
和标题代码

<td style="width:200px;">
<a href="@Url.Action("Szczegoly", new { id = item.TowarId })"
data-toggle="tooltip"
title="
  <div style='position:relative'>
  <img src='@item.FotoUrl' class='imgTooltip' />
  <span style=' position:absolute; top:0; font-size:25px;'>
  @Html.DisplayFor(modelItem => item.Nazwa)
  </span>
  <span style='text-align: right; position:absolute; 
  bottom:0; right:0; font-size:25px;'>
  @Html.DisplayFor(modelItem => item.Cena)
  </span>
  </div>
">
<img src="@item.FotoUrl" alt="@item.Nazwa" class="img-thumbnail" style="width:150px;height:auto;box-shadow: 5px 5px 5px #888888;"/>
</a>
</td>

它看起来像:

我想在工具提示中添加链接,这样它就不会在工具提示上消失

知道我该怎么做吗


这不是商业项目,我是为了通过项目学校(它是我网上商店的一部分)而做的。

你需要使用属性
data html=“true”

因此:


您需要使用属性
data html=“true”

因此:


好的,我找到了问题的解决方案,但我使用了popover而不是工具提示

<script>
  $(document).ready(function () {
   $("a.apop").popover({
    animation: false,
    placement: 'right',
    html: true,
    delay: { show: 750, hide: 100 },
    container: $(this).attr('id'),
    content: function () {
    $return = '<div class="hover-hovercard"></div>';
    }
    }).on("mouseenter", function () {
      var _this = this;
      $(this).popover("show");
      $(this).siblings(".popover").on("mouseleave", function () {
      $(_this).popover('hide');
    });
    }).on("mouseleave", function () {
      var _this = this;
      setTimeout(function () {
      if (!$(".popover:hover").length) {
      $(_this).popover("hide")
      }
    }, 100);
  });
 });
</script>

$(文档).ready(函数(){
$(“a.apop”).popover({
动画:错,
位置:'对',
是的,
延迟:{显示:750,隐藏:100},
容器:$(this.attr('id'),
内容:功能(){
$return='';
}
}).on(“mouseenter”,函数(){
var_this=这个;
$(此).popover(“显示”);
$(this).this(.popover”).on(“mouseleave”,函数(){
$(_this.popover('hide');
});
}).on(“mouseleave”,函数(){
var_this=这个;
setTimeout(函数(){
如果(!$(“.popover:hover”).length){
$(_this).popover(“隐藏”)
}
}, 100);
});
});

好的,我找到了问题的解决方案,但我使用了popover而不是工具提示

<script>
  $(document).ready(function () {
   $("a.apop").popover({
    animation: false,
    placement: 'right',
    html: true,
    delay: { show: 750, hide: 100 },
    container: $(this).attr('id'),
    content: function () {
    $return = '<div class="hover-hovercard"></div>';
    }
    }).on("mouseenter", function () {
      var _this = this;
      $(this).popover("show");
      $(this).siblings(".popover").on("mouseleave", function () {
      $(_this).popover('hide');
    });
    }).on("mouseleave", function () {
      var _this = this;
      setTimeout(function () {
      if (!$(".popover:hover").length) {
      $(_this).popover("hide")
      }
    }, 100);
  });
 });
</script>

$(文档).ready(函数(){
$(“a.apop”).popover({
动画:错,
位置:'对',
是的,
延迟:{显示:750,隐藏:100},
容器:$(this.attr('id'),
内容:功能(){
$return='';
}
}).on(“mouseenter”,函数(){
var_this=这个;
$(此).popover(“显示”);
$(this).this(.popover”).on(“mouseleave”,函数(){
$(_this.popover('hide');
});
}).on(“mouseleave”,函数(){
var_this=这个;
setTimeout(函数(){
如果(!$(“.popover:hover”).length){
$(_this).popover(“隐藏”)
}
}, 100);
});
});

它将改变什么?我的工具提示使用html,但当我将鼠标移到工具提示上时,它会消失。它会发生什么变化?我的工具提示使用html,但当鼠标移到工具提示上时,它会消失。