html Modal popup

后端 未结 6 1440
别跟我提以往
别跟我提以往 2020-12-03 08:05

How to make a simple modal popup for the following code.And on click on the background the modal popup should not disappear.




        
6条回答
  •  再見小時候
    2020-12-03 08:24

    you can also use native HTML5.1 dailog. currently dialog element is only supported in Chrome 37+, Safari 6+ and Opera 24+.

    var dailog = document.getElementById("dialog"); 
    
    function openModal() { 
       // dailog.show(); 
          dailog.showModal();
    } 
    
    function closeModal() { 
        dailog.close(); 
    } 
    #dialog{width:300px;}
    .right{float:right}
    
    
    
    This is a dialog window


提交回复
热议问题