jQWidgets jqxNotification showCloseButton属性
QWidgets是一个JavaScript框架,用于为PC和移动设备制作基于网络的应用程序。它是一个非常强大和优化的框架,与平台无关,并且被广泛支持。jqxNotification代表一个jQuery widget,可以用来向用户显示一些通知内容。jqxNotification widget的内容可以根据用户的需要进行修改。
showCloseButton属性用于设置或返回showCloseButton属性,即该属性用于设置或返回是否显示一个关闭按钮。它接受布尔类型的值,其默认值为真。
语法:
设置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属性。
<!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>
输出: