写web页面还在用传统的alert弹出框吗?用它会比较好看吧~
进击的前端huger 2017-11-27 13:17:04
在日常开发中,我们经常会在交互的过程中以alert弹出框的形式给用户通知。虽说根据不同浏览器alert样式不尽一致,但是那种灰溜溜的感觉使得用户体验性并不是很好,今天给大家推荐一款好看的仿桌面通知,丰富大家的页面。
PNotify
就是这个了
这效果看起来应该还不错吧~
用法还是很简单的,引入文件(文件可自行百度搜索PNotify)后,像下面这样写:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="./pnotify.custom.min.css">
</head>
<body>
<script src="./jquery-1.12.0.min.js"></script>
<script src="./pnotify.custom.min.js"></script>
<script type="text/javascript">
$(function(){
new PNotify({
title: 'Regular Notice',
text: 'Check me out! I'm a notice.'
});
new PNotify(
'Check me out!'
);
new PNotify({
title: 'Regular Success',
text: 'That thing that you were trying to do worked!',
type: 'success'
});
});
</script>
</body>
</html>
当然,上述方法只是一个,还要有很多效果,官网是这个https://sciactive.com/pnotify/,想了解可自行去查阅~~大家觉得怎么样呢