引导程序的弹出延迟不起作用

编程入门 行业动态 更新时间:2024-10-27 23:16:44
本文介绍了引导程序的弹出延迟不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我希望过一会儿才能隐藏弹出窗口.我对此进行了编码-> CODE 工作.. JS

I want the popover to hide after a while. I coded this -> CODE work..JS

$('#qoo').popover({ placement : 'left', html : true, delay: { show: 500, hide: 100 }, content: function() { return $('#content-wrapper1').html(); }

});

HTML

<div class="span1 offset1"> <a href="#" id="qoo" rel="popover" data-original-title="TITLEEEE" class="circle"> textttt</a> <div id="content-wrapper1" class="content-wrapper"> texttttttat</div> </div>

但这是行不通的.

推荐答案

延迟显示/隐藏不会自动显示/隐藏弹出窗口,它在之前定义了延迟!另外,延迟不适用于手动触发器类型,因此您必须具有触发器,例如hover.延误工作.

Delay show / hide does not automatically show / hide the popover, it defines the delays before doing so! Also, delay does not apply to manual trigger type, so you must have a trigger, like hover. to get the delays to work.

$('#qoo').popover({ placement : 'right', html : true, trigger : 'hover', //<--- you need a trigger other than manual delay: { show: "500", hide: "100" }, content: function() { return $('#content-wrapper1').html(); } });

但是,要实现针对弹出窗口的自动隐藏,您可以通过挂钩shown.bs.popover事件来执行以下操作:

However, to achieve automatically hide for the popover, you can do the following by hooking into the shown.bs.popover event :

$('#qoo').on('shown.bs.popover', function() { setTimeout(function() { $('#qoo').popover('hide'); }, 1000); });

上面的内容在1000毫秒(1秒)后隐藏了弹出窗口.

The above hides the popover after 1000 ms, 1 second.

更多推荐

引导程序的弹出延迟不起作用

本文发布于:2023-10-06 19:48:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1467647.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:弹出   不起作用   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!