jQuery Dialog Box

后端 未结 10 1956
暖寄归人
暖寄归人 2020-12-07 15:39

Im trying to do a dialog box with jquery. In this dialog box Im going to have terms and conditions. The problem is that the dialog box is only displayed for the FIRST TIME.<

相关标签:
10条回答
  • 2020-12-07 16:25

    If you need to use multiple dialog boxes on one page and open, close and reopen them the following works well:

     JS CODE:
        $(".sectionHelp").click(function(){
            $("#dialog_"+$(this).attr('id')).dialog({autoOpen: false});
            $("#dialog_"+$(this).attr('id')).dialog("open");
        });
    
     HTML: 
        <div class="dialog" id="dialog_help1" title="Dialog Title 1">
            <p>Dialog 1</p>
        </div>
        <div class="dialog" id="dialog_help2" title="Dialog Title 2">
            <p>Dialog 2 </p>
        </div>
    
        <a href="#" id="help1" class="sectionHelp"></a>
        <a href="#" id="help2" class="sectionHelp"></a>
    
     CSS:
        div.dialog{
          display:none;
        }
    
    0 讨论(0)
  • 2020-12-07 16:25

    This is a little more concise and also allows you to have different dialog values etc based on different click events:

    $('#click_link').live("click",function() {
        $("#popup").dialog({modal:true, width:500, height:800});
    
        $("#popup").dialog("open");
    
        return false;
    });
    
    0 讨论(0)
  • 2020-12-07 16:28

    if You want to change opacity for all dialog then change in jquery-ui.css

    /* Overlays */
    .ui-widget-overlay
    {
        background: #5c5c5c url(images/ui-bg_flat_50_5c5c5c_40x100.png) 50% 50% repeat-x;
        opacity: .50;
        filter: Alpha(Opacity=80);
    }
    
    0 讨论(0)
  • 2020-12-07 16:40
    <script type="text/javascript">
    // Increase the default animation speed to exaggerate the effect
    $.fx.speeds._default = 1000;
    $(function() {
        $('#dialog1').dialog({
            autoOpen: false,
            show: 'blind',
            hide: 'explode'
        });
    
        $('#Wizard1_txtEmailID').click(function() {
            $('#dialog1').dialog('open');
            return false;
        });
        $('#Wizard1_txtEmailID').click(function() {
            $('#dialog2').dialog('close');
            return false;
        });
        //mouseover
        $('#Wizard1_txtPassword').click(function() {
            $('#dialog1').dialog('close');
            return false;
        });
    
    });
    
    
    
    /////////////////////////////////////////////////////
     <div id="dialog1" title="Email ID">
                                                                                                                    <p>
                                                                                                                        (Enter your Email ID here.)
                                                                                                                        <br />
                                                                                                                    </p>
                                                                                                 </div>
     ////////////////////////////////////////////////////////
    
    <div id="dialog2" title="Password">
                                                                                                                    <p>
                                                                                                                        (Enter your Passowrd here.)
                                                                                                                        <br />
                                                                                                                    </p>
                                                                                                  </div>
    
    0 讨论(0)
提交回复
热议问题