Jquery消息提示插件toastr使用详解

这里写图片描述

//常规消息提示,默认背景为浅蓝色  
 toastr.info("你有新消息了!");  
//成功消息提示,默认背景为浅绿色 
 toastr.success("你有新消息了!"); 
//警告消息提示,默认背景为橘黄色 
 toastr.warning("你有新消息了!"); 
//错误消息提示,默认背景为浅红色 
 toastr.error("你有新消息了!");  
//带标题的消息框
 toastr.success("你有新消息了!","消息提示");
//另一种调用方法
 toastr["info"]("你有新消息了!","消息提示");

自定义用法

// 设置弹框参数
toastr.options = {
    closeButton: true,// 是否显示关闭按钮
    progressBar: true,// 实现显示计时条
    timeOut: "3000",  // 自动关闭时间
    positionClass: "toast-bottom-left" // 提示位置
    // positionClass: "toast-top-full-width" // 提示位置
    // toast-top-full-width 顶端,宽度铺满整个屏幕
    // toast-top-right  顶端右边
};

http://www.cnblogs.com/xyz1220/p/7350408.html

猜你喜欢

转载自blog.csdn.net/jxl9910/article/details/80325769