Twitter Bootstrap 模式 - IsShown [英] Twitter Bootstrap Modal - IsShown

查看:18
本文介绍了Twitter Bootstrap 模式 - IsShown的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位 SO 用户,您好,

Hello Fellow SO users,

在我自动填充模态框时遇到了这个问题.

Got this problem where i auto populate a modal box.

有时它已经有内容,所以我尝试对每个请求进行隐藏/显示.但是显示在隐藏功能完成之前被触发,所以它破坏了脚本.

Sometimes it already has content, so i tried doing a hide/show on each request. But the show is fired before the hide function is done, so it breaks the script.

我无法绑定到隐藏",因为如果这是第一次 - 它不会从引导程序中触发隐藏功能.

I can't do a bind to "hidden", because if it's the first time - it won't fire the hidden function from bootstrap.

使用 modal('true') 我可以看到该对象有一个 isShown 元素,但有人知道我如何访问它吗?

Using modal('true') i can see the object has a isShown element, but does anyone know how i can access it?

console.log 显示:

The console.log shows this:

$backdrop
    [div.modal-backdrop]

$element
    [div#modal-from-dom.modal]

isShown
    true

settings
    Object { backdrop="static", keyboard=true, show=false}

hide
    function()

show
    function()

toggle
    function()

__proto__
    Object { toggle=function(), show=function(), hide=function()}

推荐答案

回答 Twitter Bootstrap 3:

$("element").data()['bs.modal'].isShown

$("element").data('bs.modal').isShown

这篇关于Twitter Bootstrap 模式 - IsShown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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