一个简单的 jQuery确认对话框插件,显示弹出层后背景显示灰色遮罩,可自定义设置对话框主题颜色。
To use default settings just set confirm and cancel properties
$('#btn').click(function(){ new Confirm({ confirm:function (){ //doSomthing }, cancel:function (){ //doSomthing } }); });
To customise settings, set any of the properties you want.
$('#btn').click(function(){ new Confirm({ theme:'dark', confirmBtn:'yes', cancelBtn:'no', confirm:function (){ //doSomthing }, cancel:function (){ //doSomthing } }); });
To change the direction to rtl for Farsi and Arabic languages set direction property value to 'drtl'
$('#btn').click(function(){ new Confirm({ direction:'drtl', confirmBtn:'بله', cancelBtn: 'خیر', title:'تایید', message:'آیا از ادامه کار مطئن هستید؟', confirm:function (){ //doSomthing }, cancel:function (){ //doSomthing } }); });