在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ HTML/ jQuery UI Button 示例(一)
jQuery UI Tab 示例(一)
jQuery UI Datepicker 示例(四)
jQuery UI 示例
jQuery UI Slider 示例(二)
jQuery UI Dialog 示例(一)
HTML Get
動(dòng)畫(huà)效果
終止動(dòng)畫(huà)
回調(diào)函數(shù)
方法鏈
jQuery UI Button 示例(一)
jQuery UI Autocomplete 示例(三)
jQuery UI Autocomplete 示例(二)
設(shè)置或取得元素的 CSS class
jQuery UI 概述
基本語(yǔ)法
jQuery UI Datepicker 示例(一)
jQuery UI Autocomplete 示例(一)
jQuery UI Spiner 示例
jQuery UI Tab 示例(二)
淡入淡出效果
顯示/隱藏內(nèi)容
HTML Set
jQuery UI Tooltip 示例
jQuery UI Slider 示例(一)
讀寫 HTML 元素的 css 屬性
jQuery UI Datepicker 示例(二)
添加HTML元素
操作 HTML 元素的大小
jQuery UI Datepicker 示例(五)
滑動(dòng)效果
jQuery UI Dialog 示例(二)
jQuery UI Menu 示例
jQuery UI 基本工作過(guò)程
jQuery UI Button 示例(二)
jQuery UI Dialog 示例(三)
jQuery UI Datepicker 示例(三)
Selectors
jQuery UI Progressbar 示例
Events
jQuery UI Accordion 示例
刪除HTML元素

jQuery UI Button 示例(一)

jQuery Button 組件可以增強(qiáng)表單(Form) 中的 Buttons,Inputs 和 Anchor元素,使其具有按鈕顯示風(fēng)格,能夠正確對(duì)鼠標(biāo)滑動(dòng)做出反應(yīng)。

基本用法

下例顯示把表單中的 button,input 和 anchor 元素都變?yōu)榘粹o風(fēng)格的 jQuery Button 組件。

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>jQuery UI Demos</title>
    <link rel="stylesheet" href="themes/trontastic/jquery-ui.css" />
    <script src="scripts/jquery-1.9.1.js"></script>
    <script src="scripts/jquery-ui-1.10.1.custom.js"></script>
    <script>
        $(function () {
            $("input[type=submit], a, button")
              .button()
              .click(function (event) {
                  event.preventDefault();
              });
        });
    </script>
</head>
<body>

    <button>A button element</button>

    <input type="submit" value="A submit button" />

    <a href="#">An anchor</a>

</body>
</html>

http://wiki.jikexueyuan.com/project/jquery-tutorial/images/28.png" alt="" />

checkboxes

除了支持基本的按鈕外,jQuery Button 組件可以把類型為 checkbox 的 input 元素變?yōu)榘粹o,這種按鈕可以有兩種狀態(tài),原態(tài)和按下?tīng)顟B(tài)。

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>jQuery UI Demos</title>
    <link rel="stylesheet" href="themes/trontastic/jquery-ui.css" />
    <script src="scripts/jquery-1.9.1.js"></script>
    <script src="scripts/jquery-ui-1.10.1.custom.js"></script>
    <script>
        $(function () {
            $("input[type=submit], a, button")
              .button()
              .click(function (event) {
                  event.preventDefault();
              });
        });
    </script>
</head>
<body>
    <button>A button element</button>
    <input type="submit" value="A submit button" />
    <a href="#">An anchor</a>
</body>
</html>

http://wiki.jikexueyuan.com/project/jquery-tutorial/images/29.png" alt="" />

顯示圖標(biāo)

按鈕也可以添加圖標(biāo),可以支持多個(gè)圖標(biāo),分別使用 primary 和 secondary 來(lái)指明。

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>jQuery UI Demos</title>
    <link rel="stylesheet" href="themes/trontastic/jquery-ui.css" />
    <script src="scripts/jquery-1.9.1.js"></script>
    <script src="scripts/jquery-ui-1.10.1.custom.js"></script>
    <script>
        $(function () {
            $("button:first").button({
                icons: {
                    primary: "ui-icon-locked"
                },
                text: false
            }).next().button({
                icons: {
                    primary: "ui-icon-locked"
                }
            }).next().button({
                icons: {
                    primary: "ui-icon-gear",
                    secondary: "ui-icon-triangle-1-s"
                }
            }).next().button({
                icons: {
                    primary: "ui-icon-gear",
                    secondary: "ui-icon-triangle-1-s"
                },
                text: false
            });
        });
    </script>
</head>
<body>
    <button>Button with icon only</button>
    <button>Button with icon on the left</button>
    <button>Button with two icons</button>
    <button>Button with two icons and no text</button>
</body>
</html>

http://wiki.jikexueyuan.com/project/jquery-tutorial/images/30.png" alt="" />

Radio 單選鈕

同樣,jQuery 也把 type 為 radio 的一組 Radio 按鈕構(gòu)成一組單選鈕,使用.buttonset 將多個(gè)單選鈕定義為一個(gè)組,其中只有一個(gè)可以是選中狀態(tài)。

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>jQuery UI Demos</title>
    <link rel="stylesheet" href="themes/trontastic/jquery-ui.css" />
    <script src="scripts/jquery-1.9.1.js"></script>
    <script src="scripts/jquery-ui-1.10.1.custom.js"></script>
    <script>
        $(function () {
            $("#radio").buttonset();
        });
  </script>
</head>
<body>

<form>
  <div id="radio">
      <input type="radio" id="radio1" name="radio" />
      <label for="radio1">Choice 1</label>
      <input type="radio" id="radio2" name="radio" checked="checked" />
      <label for="radio2">Choice 2</label>
      <input type="radio" id="radio3" name="radio" />
      <label for="radio3">Choice 3</label>
  </div>
</form>
 </body>
</html>

http://wiki.jikexueyuan.com/project/jquery-tutorial/images/31.png" alt="" />