目录

Dialog

描述 (Description)

Widget Dialog功能可以与JqueryUI中的小部件一起使用。 对话框是在HTML页面上显示信息的好方法之一。 对话框是一个带有标题和内容区域的浮动窗口。 此窗口可以移动,调整大小,当然,默认情况下使用“X”图标关闭。

语法 (Syntax)

以下是使用Dialog的简单语法 -

$( "#dialog" ).dialog();

例子 (Example)

以下是一个显示Dialog用法的简单示例 -

<!doctype html>
<html lang = "en">
   <head>
      <meta charset = "utf-8">
      <title>jQuery UI Dialog - Default functionality</title>
      <link rel = "stylesheet" 
         href = "//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
      <script type = "text/javascript" 
         src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
      </script>
      <script type = "text/javascript" 
         src = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js">
      </script>
      <script>
         $(function() {
            $( "#dialog" ).dialog();
         });
      </script>
   </head>
   <body>
      <div id = "dialog" title = "Basic dialog">
         <p>This is the default dialog which is useful for displaying
            information. The dialog window can be moved, resized and closed with
            the 'x' icon.</p>
      </div>
   </body>
</html>

这将产生以下结果 -

新页面打开
↑回到顶部↑
WIKI教程 @2018