SORU
24 Kasım 2009, Salı


iletişim düğmesi odak jQuery UI

ne zaman bir jQuery UI iletişim kutusu açar gibi görünüyor seçmek için bu düğmeleri olayları ya da ayarlar durulacak vs... Nasıl durdurabilirim bu davranış, böylece hiçbir düğme vurgulanmış iletişim kutusu açar?

EDİT
Düğmeleri odağı kaldırma etmedi iletişim seçenekleri takip etmeye çalıştım

...
open:function(event, ui) { $("myunimportantdiv").focus(); },
...

NOT
geçici bir çözüm olarak ui-state-odak için css değiştirdim ama bu ideal değil...

CEVAP
3 ŞUBAT 2010, ÇARŞAMBA


Bulanıklık yöntemi kullanın. Bu örneği deneyebilirsiniz.

<html>
    <head>
        <title>No Focus on jQuery Dialog</title>
        <link type="text/css" rel="stylesheet" href="ui.all.css" />
        <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="ui.core.js"></script>
        <script type="text/javascript" src="ui.dialog.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                // Dialog to confirm or cancel
                // Focuses on confirm by default.
                $('#noFocusDialog').dialog({
                    autoOpen: false,
                    buttons: {
                        Confirm: function() {
                            $(this).dialog('close');
                        },
                        Cancel: function() {
                            $(this).dialog('close');
                        }
                    }
                });

                // Trigger to open the dialog
                $('#openNoFocusDialog').click(function() {
                    $('#noFocusDialog').dialog('open');

                    // Remove focus on all buttons within the
                    // div with class ui-dialog
                    $('.ui-dialog :button').blur();
                });
            });
        </script>
    </head>
    <body>
        <a id="openNoFocusDialog" href="#">Open Dialog</a>
        <div id="noFocusDialog">
            <p>Confirm that no elements have focus</p>
        </div>
    </body>
</html>

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Fuse

    Fuse

    21 Kasım 2005
  • Paul Schroder

    Paul Schrode

    30 Kasım 2007
  • ravinderosahn

    ravinderosah

    20 Temmuz 2009