Bootstrap Popover - 如何在文本弹出窗口中添加链接? [英] Bootstrap Popover - how add link in text popover?

查看:140
本文介绍了Bootstrap Popover - 如何在文本弹出窗口中添加链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我想在文本popvover上链接 p>

代码:

 < a href =#
角色=按钮
class =btn popovers
data-toggle =popover
title =
data-content =测试内容< a href =title =测试添加链接>内容链接< / a>
data-original-title =test title
>
测试链接
< / a>

但是当我用html开始代码时,我看到:

 < a href =#role =buttonclass =btn popoversdata-toggle =popovertitle = data-content =test content& lt; a href ==>内容链接< / a> 

data-original-title =test title
& gt;
测试链接

我知道符号 但我不知道在链接中添加链接...

aright code?



PS:如果问题已经存在请给我链接。

您需要传递 html 选项,其值 true c>同时初始化弹出窗口,如下所示。



演示



JS:

  $([data )
.popover({html:true})

HTML:

 < a href =#role =buttonclass =btn popovers data-toggle =popovertitle =data-content =test content< a href =''title ='test add link'> link on content< / a>data-original-title =测试标题>测试链接< / a> 


I use bootstrap 3 popover.

And now I would like link on text popvover.

Code:

<a href="#" 
  role="button" 
  class="btn popovers" 
  data-toggle="popover" 
  title="" 
  data-content="test content <a href="" title="test add link">link on content</a>" 
  data-original-title="test title"
  >
  test link
</a>

But when I start code in html I see:

<a href="#" role="button" class="btn popovers" data-toggle="popover" title="" data-content="test content &lt;a href=" "="">link on content</a>
" 
data-original-title="test title"
&gt;
test link

I know that problem in symbol " but i don't know have add link in link...

Tell me please how will be aright code?

P.S.: if question already exist please give me link.

解决方案

You'll need to pass html option with value true while initializing popover like following.

Demo

JS:

$("[data-toggle=popover]")
.popover({html:true})

HTML:

<a href="#" role="button" class="btn popovers" data-toggle="popover" title="" data-content="test content <a href='' title='test add link'>link on content</a>" data-original-title="test title">test link</a>

这篇关于Bootstrap Popover - 如何在文本弹出窗口中添加链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆