HTML 引导弹出框函数
HTML bootstrap popover function
我想知道引导程序给出的弹出窗口,我有以下事情 -
<a href="javascript: void(0)" id="member1" rel="popover" data-content="Co-President sample@uic.edu" data-original-title="Liz Sample"><img src="femaleprofilepicture2.jpg" class="img-polaroid"></a>
截至目前,当我点击图片时,我在同一行上同时获得联合总裁和 sample@uic.edu。如何使它们出现在不同的行上。
谢谢
一种方法是将引导弹出框内容设为 html 并将 html 设置为 true,并在两者之间提供一个<br/>
:
data-content="Co-President <br/> sample@uic.edu"
和data-html="true"
即:
<a href="javascript: void(0)" id="member1" data-placement="bottom" rel="popover" data-content="Co-President <br/> sample@uic.edu" data-html="true" data-original-title="Liz Sample"><img src="femaleprofilepicture2.jpg" class="img-polaroid"/></a>
小提琴
但是最好单独创建 html 内容并通过选项将其填充到弹出窗口中。
像这样:
.HTML:
<a href="javascript: void(0)" id="member1" data-contentwrapper=".mycontent" rel="popover"><img src="femaleprofilepicture2.jpg" class="img-polaroid"/></a>
<div class="mycontent"> <!-- Here i define my content and add an attribute data-contentwrapper t0 a selector-->
Co-President <br/>
sample@uic.edu
</div>
.JS:
$('[rel=popover]').popover({
html:true,
placement:'bottom',
content:function(){
return $($(this).data('contentwrapper')).html();
}
});
小提琴
相关文章:
- HTML表单提交时未执行外部函数
- 如何将输入(type=text)从html表单传递到javascript函数
- 从html创建一个指令,该指令按类名应用函数
- 将JavaScript函数与HTML分离
- 使用html表单中的参数调用JavaScript函数
- 从HTML调用typescript文件中的函数
- 如果使用javascript函数屏幕太小,我该如何更改HTML文件的背景色
- 从Chrome扩展名中的popup.html文件在background.js文件中运行一个函数
- 如何在HTML元素上创建函数,而不是将元素作为参数传递
- php函数的ajax html$_POST值返回null
- 函数jquery.html()不提供数据属性集值
- HTML 按钮点击函数无法使用 jQuery 变量作为参数
- 从index.html调用函数,该函数无限循环
- HTML如何根据javascript函数的返回值限制文本输入
- 如何使用Javascript/Jquery/HTML5函数将HTML页面捕获为图像
- 将 HTML 添加到 Javascript IF 函数
- 在函数 HTML 中运行 getelementbyid
- 如何在 onclick 函数 HTML 中传递字符串
- jQuery/MVC3函数html onclick只工作一次
- 每次点击调用函数(HTML包括帧)