私は確認ボタンのようにキャンセルボタンの色を変更しようとしていますが、何らかの理由で機能しないようです。SweetAlert - ボタンの色を変更する
(https://jsfiddle.net/x20ra1o1/を参照してください))
コードは、次のとおりです。
swal({ title: "Are you sure?", text: "You will not be able to recover this imaginary file!", type: "warning", showCancelButton: true, cancelButtonColor: "#DD6B55", confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, delete it!", cancelButtonText: "No, cancel plx!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { swal("Deleted!", "Your imaginary file has been deleted.", "success"); } else { swal("Cancelled", "Your imaginary file is safe :)", "error"); } });
'cancelButtonColor'は、私はドキュメントでそのオプションが表示されない[API](http://t4t5.github.io/sweetalert/) – chazsolo
ではオプションではありません。多分それはサポートされていないかもしれません。 CSSを使用して、いつでも独自のクラスを作成できます。 –
これを試してみてください.... https://jsfiddle.net/x20ra1o1/2/ – Hackerman