jquery轻量级自定义弹出层对话框插件

一个简单的 jQuery确认对话框插件,显示弹出层后背景显示灰色遮罩,可自定义设置对话框主题颜色。

Simple confirmation

To use default settings just set confirm and cancel properties

        $('#btn').click(function(){
          new Confirm({
            confirm:function (){
               //doSomthing
            },
            cancel:function (){
               //doSomthing
            }
          });
        });
    

Custome confirmation dialog

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
            }
          });
        });
    

Right to Left

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
            }
          });
        });