解决方案 »

  1.   

    $( "#dialog" ).dialog({ autoOpen: false,draggable:false });
      

  2.   

    $("#dialog").dialog({ autoOpen: false,draggable:false });全部放在这个json对象里面,楼主知道什么是json吧。其他内容就全部放到dialog容器里面就行了<div id="dialog" title="标题">
     
    内容
    <button id="close">关闭</button>

    </div>
      

  3.   


    这个只是设置属性是吗?我要是想点击一个按钮出发onclick事件是不是还得写一个
    function opendialog()
    {
    $("#dialog").dialog("open");
    }
      

  4.   


    我想在一个按钮触发onclick事件后显示这个弹出框,顺便把我要传过来的数据显示在这个弹出框中!怎么传数据呢?数据在这个弹出框中显示出来后可以修改!并且修改后还要传到后台代码里!这两步怎么弄呢!给说下思路就可以!谢谢了!
      

  5.   

    function opendialog()
    {
    //获取数据的代码
       $("#dialog").prepend("动态获取到的内容").dialog("open");
        }其实就是用jquery的方法先填充父容器的内容,在调用dialog的open方法打开
      

  6.   


    你好,再请教一下,就是我不想让它弹出的这个对话框是当前页面的div,而是一个url地址请求的页面,我要如何弄呢!谢谢了!
      

  7.   


    你好,再请教一下,就是我不想让它弹出的这个对话框是当前页面的div,而是一个url地址请求的页面,我要如何弄呢!谢谢了!容器是要的,使用jquery的ajax加载那个页面到容器中,在对容器调动dialog方法
    <script>
    function opendialog()
    {
    $("#dialog").load('xxxxxxxx.html',function(){//执行dialog方法放到成功回调里面   $("#dialog").dialog("open");
    });
        }
    </script>
    <div id="dialog"></div>
      

  8.   


    你好,再请教一下,就是我不想让它弹出的这个对话框是当前页面的div,而是一个url地址请求的页面,我要如何弄呢!谢谢了!容器是要的,使用jquery的ajax加载那个页面到容器中,在对容器调动dialog方法
    <script>
    function opendialog()
    {
    $("#dialog").load('xxxxxxxx.html',function(){//执行dialog方法放到成功回调里面   $("#dialog").dialog("open");
    });
        }
    </script>
    <div id="dialog"></div>
    恩,谢谢!
      

  9.   

    建议你使用lhgdialog 插件啊,也是用JQUERY的。
    http://code.google.com/p/lhgdialog/
      

  10.   

    那个是样式定义的。。样式为.ui-widget-header,需要覆盖样式<!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>dialog demo</title>
      <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
      <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
      <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>  
    <style>
    .ui-widget-header{background:#ff0000}
    </style>

    </head>
    <body>
      
    <button id="open">打开</button>
     
    <div id="dialog" title="标题">
     
    内容
    <button id="close">关闭</button>
    </div>
      
    <script>
     
    $( "#dialog" ).dialog({ autoOpen: false });
     
    $("#close").click(
                     function()
                     {
                         $("#dialog").dialog("close");
                         }
                     );
     
    $( "#open" ).click(
                      function()
                      {
                        $( "#dialog" ).dialog( "open" );
                        }
                      );
     
    </script>
      
    </body>
    </html>