activebar2.js是一款JQuery插件。可以跨浏览器平台,其依附于HTML5和CSS3语法,基于jQuery框架开发,该插件的功能是:在紧靠浏览器的最顶部,以消息栏提醒的方式通知用户自定义内容。当网站有重要、紧急的事情宜需要通知网友时,使用该插件是一个不错的选择。
参数说明:
'background': '#FFFF00',//背景颜色
'border': '#c8c8c8', //边框颜色
'highlight': '#FF0000', //鼠标移到activebar上的背景色
'font': 'Bitstream Vera Sans,verdana,sans-serif',//字体
'fontColor': '#000000',//字体颜色
'fontSize': '12px',//字体大小
'icon': 'images/activebar-information.png',//左边的图标,一般是警告
'button': 'images/activebar-closebtn.png', //右边的图标,一般是关闭
'url': null //超链接,即点击后跳转的位置
<script type="text/javascript">
$(function() {
//设置消息条通知内容
var $strTip = '温馨提示:明天有大雨,请大家出行时携带好雨具!';
//在div元素中显示通知内容
$('<div></div>').html($strTip).activebar({
'font': 'serif', //字体名
'url': 'http://www.weather.com.cn/', //点击内容的URL
'icon': 'http://www.ijquery.cn/study/demo/activebar2/images/activebar-information.png',
'button': 'http://www.ijquery.cn/study/demo/activebar2/images/activebar-closebtn.png',
});
});
</script>
GitHub 地址 :https://github.com/jakobwesthoff/activebar2