Custom “confirm” dialog in JavaScript?

前端 未结 7 1059
悲&欢浪女
悲&欢浪女 2020-12-01 06:33

I\'ve been working on an ASP.net project that uses custom \'modal dialogs\'. I use scare quotes here because I understand that the \'modal dialog\' is simply a div in my ht

7条回答
  •  清歌不尽
    2020-12-01 06:59

    SweetAlert

    You should take a look at SweetAlert as an option to save some work. It's beautiful from the default state and is highly customizable.

    Confirm Example

    sweetAlert(
      {
        title: "Are you sure?",
        text: "You will not be able to recover this imaginary file!",
        type: "warning",   
        showCancelButton: true,   
        confirmButtonColor: "#DD6B55",
        confirmButtonText: "Yes, delete it!"
      }, 
      deleteIt()
    );
    

提交回复
热议问题