# 顶部提示条 **Repository Path**: sin911/top_tip_bar ## Basic Information - **Project Name**: 顶部提示条 - **Description**: No description available - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-12-25 - **Last Updated**: 2020-12-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 顶部提示条 #### 在线预览 [http://sin911.gitee.io/top_tip_bar](http://sin911.gitee.io/top_tip_bar) #### 介绍 造个自己的顶部提示条轮子 #### 使用说明 只需引入js文件,css会自动引入 #### 举例说明 如果需要一打开页面就显示提示条,请放在ready函数中(为了保证css文件加载完毕) ``` wsjtn.ready(function () { wsjtn.topNote('ready后就出现,默认3秒') }) ``` time为0表示不会自动消失 ``` wsjtn.topNote("kof97 kof98 kof99", { full: true, closeBtn: true, color: 'success', anim: true, center:true,time:0 }, function () { document.title='提示条消失,执行回调' }) ``` 强制关闭 ``` wsjtn.forceClose() ``` #### 参数说明 wsjtn.topNote(str, opts, fn) 参数 | 必填|默认值 | 描述 ---|---|---|---| str | 是|string/html |需要显示的文字 opts.time | 否|3000 |提示条关闭时间,单位毫秒 opts.closeBtn|否|false|关闭按钮 opts.full|否|true|全屏显示 opts.center|否|true|文字居中显示 opts.anim|否|false|动画效果 opts.color|否|normal|提示条背景色(蓝色) fn(ctx,count)|否|/|提示条消失触发回调函数 -|ctx|string/html|提示条文本内容 -|count|1|提示条被调用的次数