-1

ご覧のとおり、これは初めてです。単純なコードがありますが、何らかの理由でダイアログボックスが画面の中央に表示されず、Safariでは機能しません。これは完全なコードです。いずれかのキーが押されたときにのみメッセージを開始します。誰か助けてくれませんか。

    <!doctype html>
     <html lang="en">
       <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

     <script  src="B:/wamp/www/jquery/js/jquery-1.8.2.js"></script>

       <link rel="stylesheet" href="B:/wamp/www/jquery/development-bundle/themes/base/jquery.ui.all.css">

       <script src="B:/wamp/www/jquery/development-bundle/external/jquery.bgiframe-2.1.2.js"></script>

     <script src="B:/wamp/www/jquery/development-bundle/ui/jquery.ui.core.js"></script>
     <script src="B:/wamp/www/jquery/development-bundle/ui/jquery.ui.widget.js"></script>
     <script src="B:/wamp/www/jquery/development-bundle/ui/jquery.ui.mouse.js"></script>
      <script src="B:B:/wamp/www/jquery/development-bundle/ui/jquery.ui.draggable.js"></script>
      <script src="B:B:/wamp/www/jquery/development-bundle/ui/jquery.ui.position.js"></script>
      <script src="B:/wamp/www/jquery/development-bundle/ui/jquery.ui.resizable.js"></script>
      <script src="B:/wamp/www/jquery/development-bundle/ui/jquery.ui.dialog.js"></script>
      <link rel="stylesheet" href="B:/wamp/www/jquery/development-bundle/demos/demos.css">

       <script >

          $(document).ready(function()
         {
         $("#text1").keyup(function()
    {
    $(function() {
    $( "#dialog-message" ).dialog({
        modal: true,
        buttons: {
            Ok: function() {
                $( this ).dialog( "close" );
            }
        }
    });
        });

        });
     });



     </script>
      <body>
         <div id="dialog-message"></div>

          <input type="text" id="text1"/>

      </body>
      </html>
4

1 に答える 1

0

あなたはjquery.ui.position.jsを持っているので...

$( "#dialog-message" ).dialog({
    modal: true,
    position: 'center',
    buttons: {
        Ok: function() {
            $( this ).dialog( "close" );
        }
    }
});

...動作するはずです

于 2012-11-07T15:07:23.903 に答える