ionic是一個輕量的手機UI庫,具有速度快,界面現代化、美觀等特點。為了解決其他一些UI庫在手機上運行緩慢的問題,它直接放棄了IOS6和Android4.1以下的版本支持,來獲取更好的使用體驗。

ionic Toggle(切換開關) 語法

切換開關類似與 HTML 的 checkbox 標簽,但它更易于在移動設備上使用。

ionic Toggle(切換開關) 示例

<html ng-app="ionicApp">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
        <title>PHP中文網(php.cn)</title>
        <link href="https://cdn.bootcss.com/ionic/1.3.2/css/ionic.css" rel="stylesheet">
        <script src="https://cdn.bootcss.com/ionic/1.3.2/js/ionic.bundle.min.js"></script>
    </head>
    <body>
    
    <div class="bar bar-header">
      <div class="h1 title">切換</div>
    </div>

    <div class="content has-header">

      <ul class="list">
        <li class="item item-toggle">
           HTML5
           <label class="toggle toggle-positive">
             <input type="checkbox" checked="">
             <div class="track">
               <div class="handle"></div>
             </div>
           </label>
        </li>
        <li class="item item-toggle">
           CSS3
           <label class="toggle toggle-calm">
             <input type="checkbox" checked="">
             <div class="track">
               <div class="handle"></div>
             </div>
           </label>
        </li>
        <li class="item item-toggle">
           Flashplayer
           <label class="toggle toggle-balanced">
             <input type="checkbox">
             <div class="track">
               <div class="handle"></div>
             </div>
           </label>
        </li>
        <li class="item item-toggle">
           Java Applets
           <label class="toggle toggle-energized">
             <input type="checkbox">
             <div class="track">
               <div class="handle"></div>
             </div>
           </label>
        </li>
        <li class="item item-toggle">
           JavaScript
           <label class="toggle toggle-assertive">
             <input type="checkbox" checked="">
             <div class="track">
               <div class="handle"></div>
             </div>
           </label>
        </li>
        <li class="item item-toggle">
           Silverlight
           <label class="toggle toggle-royal">
             <input type="checkbox">
             <div class="track">
               <div class="handle"></div>
             </div>
           </label>
        </li>
        <li class="item item-toggle">
           Web Components
           <label class="toggle toggle-dark">
             <input type="checkbox" checked="">
             <div class="track">
               <div class="handle"></div>
             </div>
           </label>
        </li>
      </ul>

    </div>
  </body>
</html>

運行實例 ?

點擊 "運行實例" 按鈕查看在線實例

熱門推薦

最新文章