jQuery Dialog Box

后端 未结 10 1983
暖寄归人
暖寄归人 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:14

    Looks like there is an issue with the code you posted. Your function to display the T&C is referencing the wrong div id. You should consider assigning the showTOC function to the onclick attribute once the document is loaded as well:

    $(document).ready({
        $('a.TOClink').click(function(){
            showTOC();
        });
    });
    
    function showTOC() {
        $('#example').dialog({modal:true});
    }
    

    A more concise example which accomplishes the desired effect using the jQuery UI dialog is:

       
       Show Terms & Conditions      
       
    

提交回复
热议问题