notie.js的使用

notie.js的使用

​ notie.js是一款简单实用的纯JavaScript消息提示插件。通过notie.js插件你可以制作Alert提示框,确认框和带输入的消息框。

​ jar:引入<``script` `src``=``"js/notie.js"``></``script``>

alert:
        notie.alert({
          type: 3,
          text: "ok",
          stay: false,
          time: 3,
          position: "top"
        })

属性介绍:

type alert类型,1代表Success,2代表Warning,3代表Error,4代表Information,5代表neutral

text alert里打印类容

stay 默认为false

time 弹出显示时间默认3秒,最小1秒

position 显示位置 默认top,也可以bottom

确认框:
    notie.confirm({
      text: '确认更改此配置吗?<br><b>...</b>',
      submitText: '确定',
      cancelText: '取消',
      position:top,
      cancelCallback: function () {

      }
      ,
      submitCallback: function () {

      }
    });
带输入的消息框:
    notie.input({
      text: '请输入你的年龄:',
      submitText: '提交',
      cancelText: '取消',
      cancelCallback: function () {
        notie.alert({type: 3, text: '你取消的本次输入'})
      },
      submitCallback: function (value) {
        notie.alert({type: 1, text: '你的年龄是: ' + value})
      },
      value: '',
      type: '',
      placeholder: '你的年龄输在这里'
    })
带选择的消息框:
  notie.select({
      text: '请选择功能',
      cancelText: '取消',
      cancelCallback: function () {
        notie.alert({ type: 5, text: '你取消了!' })
      },
      choices: [
        {
          text: '分享文章',
          handler: function () {
            notie.alert({ type: 1, text: '已分享!' })
          }
        },
        {
          text: '打开文章',
          handler: function () {
            notie.alert({ type: 1, text: '打开了!' })
          }
        },
        {
          type: 2,
          text: '编辑文章',
          handler: function () {
            notie.alert({ type: 2, text: '开始编辑' })
          }
        },
        {
          type: 3,
          text: '删除文章',
          handler: function () {
            notie.alert({ type: 3, text: '已删除!' })
          }
        }
      ]
    })

本文出自:https://blog.csdn.net/renhuan28/article/details/81871090

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值