A-A+
基于jQuery的jBar消息提醒插件使用例子
jBar 是一个简单和轻量级 jQuery 通知栏,JBar 允许您创建简单的行动要求,使其用户可以查看在您的网站顶端的信息。用户可以通过单击功能区切换栏的可见性
jBar是一个简单的jQuery插件,允许你在你的网站上弹出提示消息层,没有过多的动画效果和特效,比较实用的消息提示插件,可以支持自定义消息的颜色和显示效果以及位置。
使用方法:
1、引入插件文件和jQuery库
- <link rel="stylesheet" type="text/css" href="css/style.css" media="screen"/>
- <script src="jquery-1.3.2.js" type="text/javascript"></script>
- <script src="jquery.bar.js" type="text/javascript"></script>
2、通过一个jQuery选择器触发提示效果
- $("#msgup").bar({
- color : '#1E90FF',
- background_color : '#FFFFFF',
- removebutton : false,
- message : 'Your profile customization has been saved!',
- time : 4000
- });
可选参数
你可以定义以下属性:
color: Color of the notification message
background_color: Background color of the notification bar
position: The values “top” and “bottom” define the position of the bar
removebutton: Boolean defining if there should be a closing cross
message: Your customized message
time: Time in milliseconds for notification to disappear