在SweetAlert中同时隐藏按钮和显示图标?

时间:2019-01-21 14:42:05

标签: jquery sweetalert

我可以显示或隐藏图标或按钮。我不能做的是显示一个图标并隐藏按钮。我曾帮助过Jquery,但也许直接与SweetAlert有关。

PS:我仍然使用旧版本的SweetAlert 1.1.3,很遗憾,目前我无法更新。

  function broken() {
    swal({
      title: "Where is the icon?",
      text: "dammit",
      icon: "success",
      showConfirmButton: false,
      showCancelButton: false
    });
  };

  function Icon() {
    swal({
      title: "Hey little icon",
      text: "But how to hide a button without jquery?",
      type: "success",
      confirmButtonColor: "red",
      confirmButtonText: "OK",
      icon: "success"
    });
    $('.sa-button-container').hide();
  };
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet"/>
<a href="#" onclick="broken()">Call broken function</a><br><br>
<a href="#" onclick="Icon()">Call function with icon</a>

0 个答案:

没有答案