如何在 Twitter Bootstrap 框架中使用“手动"作为弹出窗口的触发选项? [英] How can I use 'manual' as a trigger option for popovers in the Twitter Bootstrap framework?

查看:31
本文介绍了如何在 Twitter Bootstrap 框架中使用“手动"作为弹出窗口的触发选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Twitter Bootstrap 框架中,Twipsy 和 Popover 插件都将手动"列为触发工具提示的选项.如何使用手动选项(即它的实际效果是什么 - 如何激活工具提示)?

In the Twitter Bootstrap framework, both the Twipsy and Popover plugins list 'manual' as an option for triggering the tooltip. How would one use the manual option (i.e. what's the practical effect of that - how does the tooltip get activated)?

回答
这就是我最终使用的(使用切换"):

Answer
This is what I ended up using (making use of 'toggle'):

jQuery(document).ready(function($) {
$('.popup-marker').popover({
        html: true,
        trigger: 'manual',
    }).click(function() {
        $(this).popover('toggle');
    });
});

推荐答案

您可以通过以下方式激活它:

You could activate it with:

$('#element').twipsy('show')

然后隐藏:

$('#element').twipsy('hide')

这篇关于如何在 Twitter Bootstrap 框架中使用“手动"作为弹出窗口的触发选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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