ã¯ããã«
ã第1åãjQuery UIã®ã¤ã³ã¿ã©ã¯ã·ã§ã³ã使ã£ã¦ã¿ãã ãã§ã¯ãjQueryã®ã¦ã¼ã¶ã¤ã³ã¿ãã§ã¼ã¹ãæ¡å¼µããjQuery UIã®ã¤ã³ã¹ãã¼ã«ãããè¦ç´ ã®ãã©ãã°ï¼ããããããªãµã¤ãºã並ã¹æ¿ãã«ã¤ãã¦åãä¸ãã¾ããã
ãä»åã¯å¼ãç¶ãjQuery UIã®ä¸ãããDialogãDatepickerãAutoCompleteãProgressBarã®ä½¿ãæ¹ãåãä¸ãã¾ãã
ãjQuery UIã§æä¾ããã¦ããæ©è½ã大ããåé¡ããã¨ã表1ã®ããã«ãªãã¾ãã
åé¡å | å 容 |
ã¤ã³ã¿ã©ã¯ã·ã§ã³ | ãã©ãã°ï¼ããããããªãµã¤ãºãªã© |
ã¦ã£ã¸ã§ãã | ã¢ã³ã¼ãã£ãªã³ããã¤ã¢ãã°ãã¿ããªã© |
ã´ã£ã¸ã¥ã¢ã«å¹æ | ã¢ãã¡ã¼ã·ã§ã³æ©è½ãã¨ãã§ã¯ãæ©è½ã®å¼·åãªã© |
対象èªè
- jQuery UIã«èå³ãããã使ã£ã¦ã¿ããã¨æã£ã¦ããæ¹
å¿ è¦ãªç°å¢ã¨æºå
jQuery UIã®ãã¦ã³ãã¼ã
ãå·çæç¹ã®jQuery UIã®ææ°çã¯ã1.8.2ã§ãã第1åãåèã«ãã¦ã³ãã¼ããã¾ãããã
Dialog
ãDialogã¯ãã¦ã¼ã¶ã®ã¢ã¯ã·ã§ã³ã«å¯¾ãã¦ãè¦åãåãåãããªã©ã®ãã¤ã¢ãã°ã表示ããããã¨ãã«å©ç¨ãã¾ããä¾ãã°ãã¦ã¼ã¶ç»é²æã«ãç»é²ãã¾ããããããã§ããï¼ãã¨ãã£ãã¡ãã»ã¼ã¸ãããã¼ã¿ãåé¤ãããæã«ãåé¤ãã¾ãããããããã§ããï¼ããªã©ã®ã¡ãã»ã¼ã¸ã表示ããããã¨ãã§ãã¾ãã
ãä»åã¯ããã¿ã³ãã¯ãªãã¯ããã¨ãï¼»OKï¼½ã¨ï¼»ãã£ã³ã»ã«ï¼½ãã¿ã³ãé ç½®ããããã¤ã¢ãã°ã表示ããããµã³ãã«ãåãä¸ãã¾ãã
ããªã¹ã1ã«Dialogãã©ã°ã¤ã³ã®ä½¿ç¨ä¾ããå³1ãå³2ã«å®è¡çµæã示ãã¾ãã
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>ãã¤ã¢ãã°ã»ãã¿ã³ãµã³ãã«</title> <style type="text/css"> #sampledialog { width: 100px; height: 100px; display:none; </style> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script> <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.2.custom.css" rel="stylesheet" /> <script type="text/javascript"> <!-- ãã//1ï¼ãã¤ã¢ãã°ã表示ããã $(function () { $("#sampledialog").dialog({ autoOpen: false, title: "ãã¤ã¢ãã°è¡¨ç¤º", width: 500, buttons: { "OK": function () { $(this).dialog("close"); }, "ãã£ã³ã»ã«": function () { $(this).dialog("close"); } } }); }); ãã//2ï¼ãã¿ã³ãã¯ãªãã¯ãããã¨ãã®å¦ç function doAction() { $("#sampledialog").dialog("open"); } //--> </script> </head> <body> //3ï¼ãã¤ã¢ãã°ã«è¡¨ç¤ºããããã¿ã³ãæå® <div id="msg">ãã¿ã³ãã¯ãªãã¯ãã¦ãã ãã</div> <div id="sampledialog">ããã«ç¢ºèªæ å ±ãªã©ãè¨è¿°ãã¾ã</div> <input type="button" id="btn" onclick="doAction()" value="ã¯ãªãã¯" /> </body> </html>
ããªã¹ãä¸ã®ã³ã¡ã³ã1ã®é¨åã®ããã«ããã¤ã¢ãã°æä½ãããå ´åã¯$("#sampledialog").dialog();ã¡ã½ããã使ç¨ãã¾ãã表2ã¯Dialogã®ãªãã·ã§ã³ã§ãã
ãªãã·ã§ã³ | 説æ |
autoOpen | èªåçã«ãã¤ã¢ãã°ã表示ãããã©ãããæå®ãã |
title | ã¿ã¤ãã«ãã¼ã«è¡¨ç¤ºãããããã¹ããæå®ãã |
width | ãã¤ã¢ãã°ã®ãµã¤ãºãæå®ãã |
buttons | ãã¤ã¢ãã°ã«è¡¨ç¤ºããããã¿ã³ãæå®ãã |
ããªã¹ã1ã§ã¯ãæå®ãããã¯ãªãã¯ãã¿ã³ãæ¼ããã¨ãã«ï¼ãªã¹ãå ã®ã³ã¡ã³ã3ï¼ãdoActionãå®è¡ããï¼2ï¼ããã¤ã¢ãã°ã表示ããã¾ãã表示ããããã¤ã¢ãã°ã¯ãï¼»OKï¼½ã¨ï¼»ãã£ã³ã»ã«ï¼½ãã¿ã³ãæå®ãã¦ãã¾ãï¼1ï¼ã