自定义一个扩展js程序:

jQuery.extend(jQuery, {
  // jQuery UI alert弹出提示
  jqalert: function(text, title, fn) {
    var html =
    '<div class="dialog" );
          me.confirmResult = false;
          return;
        }
        if (me.click) me.click(evt);
      }
      return false;
    });
    return false;
  }
});

调用方法如下:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>Fancy Validate - jQuery UI Dialog</title>
  <link href="css/cupertino/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
  <script src="js/jquery-1.7.1.min.js"></script>
  <script src="js/jquery-ui-1.8.18.custom.min.js"></script>
  <script src="demo.js"></script>
  <style>
    body { font-size: 12px; }
     /*jQuery UI fakes*/
    .ui-widget { font-size: 1em; }
    .ui-dialog .ui-dialog-buttonpane { padding-top: .1em; padding-bottom: .1em; }
  </style>
  <script>
    $(function() {
      $("#button1").click(function() {
        $.jqalert("这是普通提示!");
      });
      $("#button2").click(function() {
        $.jqtimeralert("这是自动关闭的提示!", "自动关闭提示",
          function() {
            $.jqalert("时间到");
          });
      });
      $("#button3").click(function() {
        $.jqconfirm("确定要这么做吗?", "确认提示",
          function() {
            $.jqalert("点了确定");
          },
          function() {
            $.jqalert("点了取消");
          });
      });
      $("#button4").click(function(e) {
        if ($.confirm(e, "确定要这么做吗?"))
          $.jqalert("点了确定");
      });
      $("#button5").click(function(e) {
        $.jqopen("http://www.cnblogs.com/yxlblogs", { title: "我的博客", width: 700, height: 500 });
      });
    });
  </script>
</head>
<body>
  <form action="?" />
    </div>
  </fieldset>
  </form>
</body>
</html>

相关文章:

  • 2022-12-23
  • 2021-12-14
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-04-21
  • 2021-06-14
猜你喜欢
  • 2022-12-23
  • 2022-01-17
  • 2021-12-04
  • 2021-09-19
  • 2021-10-22
相关资源
相似解决方案