<link href="css/bootstrap.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="js/bootstrap.min.js"></script> <a href="#" class="bind_hover_card" data-toggle="popover" data-placement="bottom" data-trigger="hover"><img class="commentAvatarImage" src="img/social_dribbble.png" /></a>
| animation | boolean [i]默认值:true[/i] | data-animation | 向弹出框应用 CSS 褪色过渡效果。 |
| html | boolean [i]默认值:false[/i] | data-html | 向弹出框插入 HTML。如果为 false,jQuery 的 text 方法将被用于向 dom 插入内容。如果您担心 XSS 攻击,请使用 text。 |
| placement | string|function [i]默认值:top[/i] | data-placement | 规定如何定位弹出框(即 top|bottom|left|right|auto)。 当指定为 [i]auto[/i] 时,会动态调整弹出框。例如,如果 placement 是 "auto left",弹出框将会尽可能显示在左边,在情况不允许的情况下它才会显示在右边。 |
| selector | string [i]默认值:false[/i] | data-selector | 如果提供了一个选择器,弹出框对象将被委派到指定的目标。 |
| title | string | function [i]默认值:''[/i] | data-title | 如果未指定 [i]title[/i] 属性,则 title 选项是默认的 title 值。 |
| trigger | string [i]默认值:'hover focus'[/i] | data-trigger | 定义如何触发弹出框: click| hover | focus | manual。您可以传递多个触发器,每个触发器之间用空格分隔。 |
| delay | number | object [i]默认值:0[/i] | data-delay | 延迟显示和隐藏弹出框的毫秒数 - 对 manual 手动触发类型不适用。如果提供的是一个数字,那么延迟将会应用于显示和隐藏。如果提供的是对象,结构如下所示:
delay:{ show:500, hide:100} |
| container | string | false [i]默认值:false[/i] | data-container | 向指定元素追加弹出框。 实例: container: 'body' |
$().popover(options)
Toggle: .popover('toggle')切换显示/隐藏元素的弹出框。
$('#element').popover('toggle')
Show: .popover('show')显示元素的弹出框。
$('#element').popover('show')
Hide: .popover('hide')隐藏元素的弹出框。
$('#element').popover('hide')
Destroy: .popover('destroy')隐藏并销毁元素的弹出框。
$('#element').popover('destroy')
$(function() {
$("[data-toggle='popover']").popover({
html : true,
title: title(),
delay:{show:500, hide:1000},
content: function() {
return content();
}
});
});
//模拟动态加载标题(真实情况可能会跟后台进行ajax交互)
function title() {
return '田喜碧Hebe(节制的人生)';
}
//模拟动态加载内容(真实情况可能会跟后台进行ajax交互)
function content() {
var data = $("<form><ul><li><span aria-hidden='true' class='icon_globe'></span> <font>粉丝数:</font>7389223</li>" +
"<li><span aria-hidden='true' class='icon_piechart'></span> <font>关注:</font>265</li>" +
"<li><span aria-hidden='true' class='icon_search_alt'></span> <font>微博:</font>645</li>" +
"<li><span aria-hidden='true' class='icon_pens_alt'></span> <font>所在地:</font>台湾</li>" +
"<input id='btn' type='button' value='关注' onclick='test()'/></form>");
return data;
}
//模拟悬浮框里面的按钮点击操作
function test() {
alert('关注成功');
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有