当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


jQWidgets jqxWindow closeAll()用法及代码示例


jQWidgets 是一个 JavaScript 框架,用于为 PC 和移动设备制作基于 Web 的应用程序。它是一个非常强大、优化、独立于平台且得到广泛支持的框架。 jqxWindow 用于在应用程序中输入数据或查看信息。

closeAll()方法用于关闭所有当前打开的非模态窗口。该方法不接受任何参数。

用法:

$('selector').jqxWindow('closeAll');

链接文件:下载jQWidgets从给定的链接。在 HTML 文件中,找到下载文件夹中的脚本文件。

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<link rel=”stylesheet” href=”jqwidgets/styles/jqx.summer.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery-1.10.2.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxwindow.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxbuttons.js”></script>

下面的示例说明了 jQWidgets closeAll() 方法。

例子:

HTML


<!DOCTYPE html> 
<html lang="en"> 
  
<head> 
    <link rel="stylesheet" href= 
        "jqwidgets/styles/jqx.base.css" type="text/css" /> 
    <script type="text/javascript" 
        src="scripts/jquery-1.10.2.min.js"></script> 
    <script type="text/javascript" 
        src="jqwidgets/jqxcore.js"></script> 
    <script type="text/javascript" 
        src="jqwidgets/jqxwindow.js"></script> 
    <script type="text/javascript" 
        src="jqwidgets/jqxbuttons.js"></script> 
  
    <script type="text/javascript"> 
        $(document).ready(function () { 
            $('#jqxwindow').jqxWindow({ 
                position: 'left', 
                width: 150, 
                height: 100 
            }); 
            $('#jqxwindow2').jqxWindow({ 
                height: 100, 
                width: 100 
            }); 
            $('#jqxwindow3').jqxWindow({ 
                position: 'right', 
                height: 100, 
                width: 100 
            }); 
            $("#jqxbutton").jqxButton({ 
                height: 30 
            }); 
            $('#jqxbutton').click(function () { 
                $("#jqxwindow").jqxWindow('closeAll'); 
            }); 
        }); 
    </script> 
</head> 
  
<body> 
    <center> 
        <h1 style="color: green;"> GeeksforGeeks </h1> 
        <h3> jQWidgets jqxWindow closeAll() Method </h3> 
        <input type="button" id="jqxbutton" 
            value="Invoke the closeAll() method" /> 
        <div id='content'> 
            <div id='jqxwindow'> 
                <div> Header</div> 
                <div> 
                    <div>GeeksforGeeks</div> 
                </div> 
            </div> 
            <div id='jqxwindow2'> 
                <div> Header2</div> 
                <div> 
                    <div>GFG</div> 
                </div> 
            </div> 
            <div id='jqxwindow3'> 
                <div> Header3</div> 
                <div> 
                    <div>CSE</div> 
                </div> 
            </div> 
        </div> 
    </center> 
</body> 
  
</html> 

输出:

参考: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxwindow/jquery-window-api.htm?search=



相关用法


注:本文由纯净天空筛选整理自Kanchan_Ray大神的英文原创作品 jQWidgets jqxWindow closeAll() Method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。