ie7 html自定义alert,GitHub - safly/BeAlert: 这是一个美化版的alert和confirm弹出框插件,适用于IE7+、chrome、Edge、fireFox、Safa...

BeAlert

这是一个美化版的alert和confirm弹出框插件,适用于IE7+、chrome、Edge、fireFox、Safari等绝大多数浏览器。

功能可自己拓展,这里只是一个基础版本的插件 ,能够取代系统自带的alert和confirm。

How to use?

1、需要jquery的支持,所以请先确认已经引入jquery文件;

2、添加css和js文件到你的页面中

3、按说明调用函数

alert(title,message,callback,config);

confirm(title,message,callback,config);

Settings

参数

默认值

描述

title

null

标题

message

null

内容

callback

null

回调函数

config

null

配置参数:

width: 宽度,

height: 最小高度,

type: 'warning'|'error'|'success'|'info'|'question',

showConfirmButton: 是否显示确认按钮,

showCancelButton: 是否显示取消按钮,

confirmButtonText: '确认',

cancelButtonText: '取消'

Example

$(function () {

$("#alert").click(function () {

alert("Hello world!", "welcome to my world :)", function () {

//after click the confirm button, will run this callback function

}, {type: 'success', confirmButtonText: 'OK'});

});

$("#confirm").click(function () {

confirm("Are you sure?", "You will not be able to recover this imaginary file!", function (isConfirm) {

if (isConfirm) {

//after click the confirm

} else {

//after click the cancel

}

}, {confirmButtonText: 'Yes, delete it!', cancelButtonText: 'No, cancel plx!', width: 400});

});

});

982da6023975e7bdfe2da7a7fea77d5d.png

aa954c06585ea1189e823c97a34a49e2.png

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值