EasyUi各種消息框


<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>  

   <head>        

     <title>EasyUi各種提示框</title>      

     <meta http-equiv="pragma" content="no-cache">  

     <meta http-equiv="cache-control" content="no-cache">  

     <meta http-equiv="expires" content="0">     

     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">  

     <meta http-equiv="description" content="This is my page">  

     <script type="text/javascript" src="js/jquery-easyui-1.5/jquery.min.js"></script>    

     <link rel="stylesheet" href="js/jquery-easyui-1.5/themes/default/easyui.css" type="text/css"></link>    

     <!-- icon對應的是圖片 -->  

      <link rel="stylesheet" href="js/jquery-easyui-1.5/themes/icon.css" type="text/css"></link>    

     <script type="text/javascript" src="js/jquery-easyui-1.5/jquery.easyui.min.js"></script>    

     <script type="text/javascript" src="js/jquery-easyui-1.5/locale/easyui-lang-zh_CN.js"></script>    

     <script type="text/javascript">     

        $(function(){       

            /*        

              title:提示框的標題        

              消息框彈出的內容:確定刪除嗎?        

              參數b:點擊確定返回true,點擊取消返回false        

              具體代碼實現:        

                   $.messager.confirm("提示框【title】","確定刪除嗎?",function(b){        

                        if(b){            alert("刪除成功!!!");         

                           }else{            alert("刪除失敗!!!");          

                          }         

                         });                             ************************************************************************************       

          頁面加載彈出一個可輸入文本的消息框,輸出完畢后彈出消息111       

                 title:提示框的標題        消息:提示框里面的內容       

                 val:輸出自己在文本框輸入的內容      

                  具體代碼實現:        

                     $.messager.prompt("title","消息",function(val){         

                         alert(val);        

                      });      

 ************************************************************************************        

         頁面加載后彈出一個進度條消息框        

                 具體實現代碼:       

                   $.messager.progress({          

                      title: "提示框",    提示框標題         

                       msg: "文件下載中",    提示框內的內容         

                       text: "正在加載...",   進度條內的內容          

                      interval: 300     進度條的速度                 });  

 ************************************************************************************        

        頁面加載后彈出一個帶圖片的消息框       

           這里需要注意的是:         error是一個圖片,只提供四片圖片選擇(question,info,warning,error)       

           $.messager.alert("title","內容","error",function(){               

                alert("111");              

            });             

             */      

         //這個參數為options(配置項,一般已鍵值對形式出現)      

         $.messager.show({       

           showType: "slide",  //定義消息窗口如何顯示(null,slide,fade,show)       

           showSpeed: 3000,     //定義消息窗口顯示所需的時間(單位毫秒)        

          width: 100,    //窗口寬度        

          height: 100,   //窗口高度       

           msg: "顯示的消息文字", //顯示消息文字       

           title: "標題",   //標題     

           timeout: 0    //如果定義為0,除非用戶關閉,消息不會自己關閉,定義其他,消息將在超時自動關閉             });     });                   

       </script>  

    </head>  

  <body>     

    <center>       

      <h2>EasyUi實現各種消息框</h2>      

         實現消息框需注意以下幾點:       

           1.    <!--          

              <script type="text/javascript" src="js/jquery-easyui-1.5/jquery.min.js"></script> 這行代碼必須放在第一行,其他四行順序隨便                               <link rel="stylesheet" href="js/jquery-easyui-1.5/themes/default/easyui.css" type="text/css"></link>         

              <link rel="stylesheet" href="js/jquery-easyui-1.5/themes/icon.css" type="text/css"></link>         

              <script type="text/javascript" src="js/jquery-easyui-1.5/jquery.easyui.min.js"></script>         

              <script type="text/javascript" src="js/jquery-easyui-1.5/locale/easyui-lang-zh_CN.js">        

             -->      

           2.        

             代碼必須放在頁面加載后       

                <!--        

                   $(function(){          

                    這里寫各種消息框代碼       

                     }              

                 -->      

    </center>  

  </body>

</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM