弹出框延迟显示在鼠标输入(Angularjs)上
Popover delay show on mouseenter (Angularjs)
我创建了将触发器连接到弹出框的Angularjs指令。除了我想向弹出框添加延迟显示外,一切都有效。我是javascript和angular js的新手。因此,任何帮助将不胜感激。
.directive('businessCardPopup', function() {
return {
restrict: "A",
link: function(scope, pop, attrs){
scope.label = attrs.popoverLabel;
$(pop).popover({
trigger: "manual" ,
container: 'body',
template: '<div class="popover" role="tooltip" style="width: 400px;">' +
'<div class="arrow"></div>' +
'<h3 class="popover-title"></h3>' +
'<div class="popover-content">' +
'<div class="data-content"></div>' +
'</div></div>',
html: true,
animation:false,
content: '<div class="col-lg-4"></div>' +
'<div class="col-lg-8"><p>Name</p>' +
'<p>Position</p>' +
'<p>Telephone</p>' +
'<p>Email</p>' +
'<p>Skype | Twitter | LinkedIn</p>' +
'<p>Conversation | View Profile | Follow</p></div> ',
placement: 'top',
delay: {"show": 2000}
})
.on("mouseenter", function () {
var _this = this;
$(this).popover("show");
$(".popover").on("mouseleave", function () {
$(_this).popover('hide');
});
}).on("mouseleave", function () {
var _this = this;
setTimeout(function () {
if (!$(".popover:hover").length) {
$(_this).popover("hide");
}
}, 500);
})
}
}
}
)
我认为它应该是show: "600"
而不是"show": 600
触发器类型manual
,delay
不适用于触发器类型手册。
请参阅文档:http://getbootstrap.com/javascript/#popovers-usage
您可以尝试trigger: 'focus'
。
相关文章:
- 我想在AngularJS应用程序中创建一个输入数字框,用户不应该在该框上键入十进制数字.(一个整数输入框)
- AngularJs Cordova安卓应用程序中输入的4位密码PIN验证
- 如何从输入框中获取angularJS中的值
- 在 AngularJS 中输入的数字的限制长度
- 输入类型范围在angularjs重复内不起作用
- 如何从 AngularJS 输入中禁用我的复选框
- 根据输入文本按元素排序,AngularJS
- angularJs检查是否输入
- AngularJS输入接受整数和特殊字符
- 如何获取 ng-repeat 输入 angularjs 的值
- 如何通过输入数字值动态添加文本区域输入?AngularJs.
- 比较来自输入 AngularJS 的两个 JSON 对象
- 数据仅用于显示是否触摸输入 - AngularJs
- 弹出框延迟显示在鼠标输入(Angularjs)上
- 如何将正则表达式从指令传递到输入AngularJs
- 如何在MySQL数据库中输入angularJs数组
- 使用javascript/VBA编程地输入angularjs文本字段
- 当我们为其他子搜索输入输入AngularJS输入任何值时,避免[object object]出现在主搜索输入中
- 如何验证数组输入angularjs
- 验证不适用于具有“必需”属性的文件输入 - AngularJS