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


jQWidgets jqxNotification showCloseButton属性用法及代码示例


QWidgets 是一个 JavaScript 框架,用于为 PC 和移动设备制作基于 Web 的应用程序。它是一个非常强大且优化的框架,独立于平台,并且得到广泛支持。 jqxNotification 代表一个 jQuery 小部件,可用于向用户显示一些通知内容。 jqxNotification小部件内容可以根据用户需求进行修改。

showCloseButton 属性用于设置或返回 showCloseButton 属性。即该属性用于设置或返回是否显示关闭按钮。它接受 boolean 类型值,默认值为 true。

用法:

设置 showCloseButton 属性。

$('Selector').jqxNotification({ showCloseButton : boolean});

返回 showCloseButton 属性。

var showCloseButton = 
    $('Selector').jqxNotification('showCloseButton ');

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

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

例子:下面的示例说明了 jQWidgets 中的 jqxNotification showCloseButton 属性:

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.11.1.min.js"></script> 
    <script type="text/javascript" 
        src="jqwidgets/jqxcore.js"></script> 
    <script type="text/javascript" 
        src="jqwidgets/jqxnotification.js"></script> 
</head> 
  
<body> 
    <h1 style="color: green"> 
        GeeksforGeeks 
    </h1> 
      
    <h3> 
        jQWidgets jqxNotification  
        showCloseButton property 
    </h3> 
      
    <div id="not"> 
        Notification 
    </div> 
  
    <script type="text/javascript"> 
        $(document).ready(function () { 
            $("#not").jqxNotification({ 
                position: "top-left", 
                opacity: 0.9, 
                autoOpen: true, 
                autoClose: false, 
                showCloseButton: false, 
                template: "info", 
                position: 'center' 
            }); 
        }); 
    </script> 
</body> 
  
</html>

输出:

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



相关用法


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