📌  相关文章
📜  如何使用 jQuery Mobile 创建关闭弹出窗口?

📅  最后修改于: 2021-11-24 04:54:17             🧑  作者: Mango

jQuery Mobile是一种基于 Web 的技术,用于制作可在所有智能手机、平板电脑和台式机上访问的响应式内容。在本文中,我们将使用jQuery Mobile 创建一个关闭弹出窗口。

方法:添加项目所需的 jQuery Mobile 脚本。

我们将创建一个包含关闭按钮的弹出窗口。关闭按钮可以放置在左上右上或基于类的其他位置。可以通过单击弹出窗口小部件外部或按Esc键来关闭弹出窗口。 data-dismissible=”false”属性用于防止用户在弹出框外单击时关闭弹出窗口。

例1:我们将创建一个包含在右上角关闭按钮的弹出。

HTML


  

    
  
    
  
    

  

    
        

GeeksforGeeks

           

            Design a Popup with right close              button using jQuery Mobile         

                        Popup with Right close button                     
                             Close                             

                It is an example of popup with                  closing of top-right corner.             

        
    
  


HTML


  

    
  
    
  
    

  

    
        

GeeksforGeeks

           

            Design a Popup with left close             button using jQuery Mobile         

                        Popup with Left close button                                 
                             Close                             

                It is an example of popup with                  closing of top-left corner.             

        
    
  


输出:

例2:我们将创建一个包含在左上角的关闭按钮的弹出。

HTML



  

    
  
    
  
    

  

    
        

GeeksforGeeks

           

            Design a Popup with left close             button using jQuery Mobile         

                        Popup with Left close button                                 
                             Close                             

                It is an example of popup with                  closing of top-left corner.             

        
    
  

输出: