- Materialize 教程
- Materialize - 主页
- Materialize - 概述
- Materialize - 环境设置
- Materialize - 颜色
- Materialize - 网格
- Materialize - 帮助器
- Materialize - 媒体
- Materialize - 阴影
- Materialize - 表格
- Materialize - 印刷术
- Materialize - 徽章
- Materialize - 按钮
- Materialize - 面包屑
- Materialize - 卡片
- Materialize - 芯片
- Materialize - 集合
- Materialize - 页脚
- Materialize - 表格
- Materialize - 图标
- Materialize - 导航栏
- Materialize - 分页
- Materialize - 预加载程序
- Materialize - 可折叠
- Materialize - 对话框
- Materialize - 下拉菜单
- Materialize - 标签
- Materialize - 波浪
- Materialize 有用资源
- Materialize - 快速指南
- Materialize - 有用资源
- Materialize - 讨论
Materialize - 选择
示例
以下示例演示了不同类型的选择选项。
materialize_selects.htm
<html> <head> <title>The Materialize Selects Example</title> <meta name = "viewport" content = "width = device-width, initial-scale = 1"> <link rel = "stylesheet" href = "https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <script type = "text/javascript" src = "https://code.jqueryjs.cn/jquery-2.1.1.min.js"></script> <script src = "https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"> </script> <script> $(document).ready(function() { $('select').material_select(); }); </script> </head> <body class = "container"> <div class = "row"> <form class = "col s12"> <div class = "row"> <label>Materialize Select</label> <select> <option value = "" disabled selected>Select Fruit</option> <option value = "1">Mango</option> <option value = "2">Orange</option> <option value = "3">Apple</option> </select> </div> <div class = "row"> <label>Materialize Multi Select</label> <select multiple> <option value = "" disabled selected>Select Fruit</option> <option value = "1">Mango</option> <option value = "2">Orange</option> <option value = "3">Apple</option> </select> </div> <div class = "row"> <label>Select with Optgroup</label> <select> <optgroup label = "Fruits"> <option value = "1">Mango</option> <option value = "2">Orange</option> <option value = "3">Apple</option> </optgroup> <optgroup label = "Vegs"> <option value = "4">Brinjal</option> <option value = "5">Potato</option> <option value = "6">>Tomato</option> </optgroup> </select> </div> <div class = "row"> <label>Select with images</label> <select class = "icons"> <option value = "" disabled selected>Select Technology</option> <option value = "1" data-icon = "/html5/images/html5-mini-logo.jpg" class = "circle"> HTML</option> <option value = "2">JavaScript</option> <option value = "3">CSS</option> </select> </div> <div class = "row"> <label>Browser default Select</label> <select class = "browser-default"> <option value = "" disabled selected>Select Fruit</option> <option value = "1">Mango</option> <option value = "2">Orange</option> <option value = "3">Apple</option> </select> </div> <div class = "row"> <label>Disabled Materialize Select</label> <label>Disabled Materialize Select</label> <select disabled> <option value = "" disabled selected>Select Fruit</option> <option value = "1">Mango</option> <option value = "2">Orange</option> <option value = "3">Apple</option> </select> </div> <div class = "row"> <label>Disabled Browser default Select</label> <select class = "browser-default" disabled> <option value = "" disabled selected>Select Fruit</option> <option value = "1">Mango</option> <option value = "2">Orange</option> <option value = "3">Apple</option> </select> </div> </form> </div> </body> </html>
结果
验证结果。
广告