Framework7智能选择

本文概述

  • Smart Select布局示例
  • Smart Select搜索栏示例
  • 自定义页面标题和反向链接文本示例
  • 在弹出示例中打开
  • 在选择器中打开示例
  • 自定义图标, 颜色和图像示例
  • 多重选择和选择组示例
  • 多选和最大长度示例
Framework7 Smart Select可以轻松地将表单选择更改为动态页面。它使用一组复选框和单选输入。
智能选择可以多种形式使用:
指数 类型 描述
1) 智能选择布局 智能选择布局用于使用智能选择类在select元素内定义列表视图。
2) 带有搜索栏的智能选择 智能选择用于通过使用搜索栏搜索元素, 并通过将data-searchbar类设置为true来启用它。
3) 自定义页面标题和反向链接文本 它使你可以使用data-page-title和data-back-text属性为智能选择设置自定义页面标题和后链接。
4) 在弹出窗口中打开 通过使用data-open-in属性弹出, 可以将智能选择作为弹出窗口打开。
5) 在选择器中打开 通过将data-open-in属性设置为picker, 可以将智能选择显示为选择器模式。
6) 自定义图标, 颜色和图像 你可以分别通过使用data-option-icon, data-option-color和data-option-image属性在智能选择上定义自定义图标, 颜色或图像。
7) 多重选择和选择组 智能选择可通过使用multiple和optgroup属性来帮助你使用多个select和group选项。
8) 多选和最大长度 智能选择可帮助你使用maxlength属性选择数量有限的项目。
Smart Select布局示例
< !DOCTYPE html> < html> < head> < meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" /> < meta name = "apple-mobile-web-app-capable" content = "yes" /> < meta name = "apple-mobile-web-app-status-bar-style" content = "black" /> < title> Smart Select Layout< /title> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" /> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" /> < /head> < body> < div class = "views"> < div class = "view view-main"> < div class = "navbar"> < div class = "navbar-inner"> < div class = "left"> < /div> < div class = "center sliding"> Smart Select Layout< /div> < div class = "right"> < /div> < /div> < /div> < div class = "pages navbar-through"> < div data-page = "home" class = "page"> < div class = "page-content"> < div class = "list-block"> < ul> < li> < a href = "http://www.srcmini.com/#" class = "item-link smart-select"> < select name = "countries"> < option value = "http://www.srcmini.com/India" selected> India< /option> < option value = "http://www.srcmini.com/Newz = Zealnad"> New Zealand< /option> < option value = "http://www.srcmini.com/Srilanka"> Srilanka< /option> < option value = "http://www.srcmini.com/WestIndies"> West Indies< /option> < option value = "http://www.srcmini.com/China"> China< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Countries< /div> < /div> < /div> < /a> < /li> < li> < a href = "http://www.srcmini.com/#" class = "item-link smart-select"> < select name = "fruits"> < option value = "http://www.srcmini.com/Apple"> Apple< /option> < option value = "http://www.srcmini.com/Pineapple"> Pineapple< /option> < option value = "http://www.srcmini.com/Pear"> Pear< /option> < option value = "http://www.srcmini.com/Orange" selected> Orange< /option> < option value = "http://www.srcmini.com/Mango"> Mango< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Fruits< /div> < /div> < /div> < /a> < /li> < li> < a href = "http://www.srcmini.com/#" class = "item-link smart-select"> < select name = "books"> < option value = "http://www.srcmini.com/EyesDragon" selected> Eyes of the Dragon< /option> < option value = "http://www.srcmini.com/Winter"> Winter Wedding< /option> < option value = "http://www.srcmini.com/DarkWood" selected> In a Dark, Dark Wood< /option> < option value = "http://www.srcmini.com/FarAway" selected> Far and Away< /option> < option value = "http://www.srcmini.com/WasteLands"> The Waste Lands< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Books< /div> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /div> < /div> < /div> < /div> < script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"> < /script> < script> // here initialize the appvar myApp = new Framework7({animateNavBackIcon:true}); // If your using custom DOM library, then save it to $$ variablevar $$ = Dom7; // Add the viewvar mainView = myApp.addView('.view-main', {// enable the dynamic navbar for this viewdynamicNavbar: true}); < /script> < /body> < /html>

立即测试
Smart Select搜索栏示例
< !DOCTYPE html> < html> < head> < meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" /> < meta name = "apple-mobile-web-app-capable" content = "yes" /> < meta name = "apple-mobile-web-app-status-bar-style" content = "black" /> < title> Smart Select Search Bar< /title> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" /> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" /> < /head> < body> < div class = "views"> < div class = "view view-main"> < div class = "navbar"> < div class = "navbar-inner"> < div class = "left"> < /div> < div class = "center sliding"> Smart Select with Search Bar< /div> < div class = "right"> < /div> < /div> < /div> < div class = "pages navbar-through"> < div data-page = "home" class = "page"> < div class = "page-content"> < div class = "list-block"> < ul> < li> < a href = "http://www.srcmini.com/#" data-searchbar = "true" data-searchbar-placeholder = "Search Countries" class = "item-link smart-select"> < select name = "countries"> < option value = "http://www.srcmini.com/India" selected> India< /option> < option value = "http://www.srcmini.com/Newz = Zealnad"> New Zealand< /option> < option value = "http://www.srcmini.com/Srilanka"> Srilanka< /option> < option value = "http://www.srcmini.com/WestIndies"> West Indies< /option> < option value = "http://www.srcmini.com/China"> China< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Countries< /div> < /div> < /div> < /a> < /li> < li> < a href = "http://www.srcmini.com/#" data-searchbar = "true" data-searchbar-placeholder = "Search Sports" class = "item-link smart-select"> < select name = "fruits"> < option value = "http://www.srcmini.com/Apple"> Apple< /option> < option value = "http://www.srcmini.com/Pineapple"> Pineapple< /option> < option value = "http://www.srcmini.com/Pear"> Pear< /option> < option value = "http://www.srcmini.com/Orange" selected> Orange< /option> < option value = "http://www.srcmini.com/Mango"> Mango< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Fruits< /div> < /div> < /div> < /a> < /li> < li> < a href = "http://www.srcmini.com/#" data-searchbar = "true" data-searchbar-placeholder = "Search Books" class = "item-link smart-select"> < select name = "books"> < option value = "http://www.srcmini.com/EyesDragon" selected> Eyes of the Dragon< /option> < option value = "http://www.srcmini.com/Winter"> Winter Wedding< /option> < option value = "http://www.srcmini.com/DarkWood" selected> In a Dark, Dark Wood< /option> < option value = "http://www.srcmini.com/FarAway" selected> Far and Away< /option> < option value = "http://www.srcmini.com/WasteLands"> The Waste Lands< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Books< /div> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /div> < /div> < /div> < /div> < script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"> < /script> < script> // here initialize the appvar myApp = new Framework7 ({animateNavBackIcon:true}); // If your using custom DOM library, then save it to $$ variablevar $$ = Dom7; // Add the viewvar mainView = myApp.addView('.view-main', {// enable the dynamic navbar for this viewdynamicNavbar: true}); < /script> < /body> < /html>

立即测试
自定义页面标题和反向链接文本示例
< !DOCTYPE html> < html> < head> < meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" /> < meta name = "apple-mobile-web-app-capable" content = "yes" /> < meta name = "apple-mobile-web-app-status-bar-style" content = "black" /> < title> Custom Page Title and Back Link Text< /title> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" /> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" /> < /head> < body> < div class = "views"> < div class = "view view-main"> < div class = "navbar"> < div class = "navbar-inner"> < div class = "left"> < /div> < div class = "center sliding"> Custom Page Title and Back Link Text< /div> < div class = "right"> < /div> < /div> < /div> < div class = "pages navbar-through"> < div data-page = "home" class = "page"> < div class = "page-content"> < div class = "list-block"> < ul> < li> < a href = "http://www.srcmini.com/#" data-page-title = "Countries List" data-back-text = "Click here to go back" class = "item-link smart-select"> < select name = "countries"> < option value = "http://www.srcmini.com/India" selected> India< /option> < option value = "http://www.srcmini.com/Newz = Zealnad"> New Zealand< /option> < option value = "http://www.srcmini.com/Srilanka"> Srilanka< /option> < option value = "http://www.srcmini.com/WestIndies"> West Indies< /option> < option value = "http://www.srcmini.com/China"> China< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Countries< /div> < /div> < /div> < /a> < /li> < li> < a href = "http://www.srcmini.com/#" data-page-title = "Sports List" data-back-text = "Click here to go back" class = "item-link smart-select"> < select name = "fruits"> < option value = "http://www.srcmini.com/Apple"> Apple< /option> < option value = "http://www.srcmini.com/Pineapple"> Pineapple< /option> < option value = "http://www.srcmini.com/Pear"> Pear< /option> < option value = "http://www.srcmini.com/Orange" selected> Orange< /option> < option value = "http://www.srcmini.com/Mango"> Mango< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Fruits< /div> < /div> < /div> < /a> < /li> < li> < a href = "http://www.srcmini.com/#" data-page-title = "Books List" data-back-text = "Click here to go back" class = "item-link smart-select"> < select name = "books"> < option value = "http://www.srcmini.com/EyesDragon" selected> Eyes of the Dragon< /option> < option value = "http://www.srcmini.com/Winter"> Winter Wedding< /option> < option value = "http://www.srcmini.com/DarkWood" selected> In a Dark, Dark Wood< /option> < option value = "http://www.srcmini.com/FarAway" selected> Far and Away< /option> < option value = "http://www.srcmini.com/WasteLands"> The Waste Lands< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Books< /div> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /div> < /div> < /div> < /div> < script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"> < /script> < script> // here initialize the appvar myApp = new Framework7 ({animateNavBackIcon:true}); // If your using custom DOM library, then save it to $$ variablevar $$ = Dom7; // Add the viewvar mainView = myApp.addView('.view-main', {// enable the dynamic navbar for this viewdynamicNavbar: true}); < /script> < /body> < /html>

立即测试
在弹出示例中打开
< !DOCTYPE html> < html> < head> < meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" /> < meta name = "apple-mobile-web-app-capable" content = "yes" /> < meta name = "apple-mobile-web-app-status-bar-style" content = "black" /> < title> Open in Popup< /title> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" /> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" /> < /head> < body> < div class = "views"> < div class = "view view-main"> < div class = "navbar"> < div class = "navbar-inner"> < div class = "left"> < /div> < div class = "center sliding"> Smart Select Open in Popup< /div> < div class = "right"> < /div> < /div> < /div> < div class = "pages navbar-through"> < div data-page = "home" class = "page"> < div class = "page-content"> < div class = "list-block"> < ul> < li> < a href = "http://www.srcmini.com/#" data-open-in = "popup" class = "item-link smart-select"> < select name = "countries"> < option value = "http://www.srcmini.com/India" selected> India< /option> < option value = "http://www.srcmini.com/Newz = Zealnad"> New Zealand< /option> < option value = "http://www.srcmini.com/Srilanka"> Srilanka< /option> < option value = "http://www.srcmini.com/WestIndies"> West Indies< /option> < option value = "http://www.srcmini.com/China"> China< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Countries< /div> < /div> < /div> < /a> < /li> < li> < a href = "http://www.srcmini.com/#" data-open-in = "popup" data-popup-close-text = "Close the List" class = "item-link smart-select"> < select name = "fruits"> < option value = "http://www.srcmini.com/Apple"> Apple< /option> < option value = "http://www.srcmini.com/Pineapple"> Pineapple< /option> < option value = "http://www.srcmini.com/Pear"> Pear< /option> < option value = "http://www.srcmini.com/Mango" selected> Mango< /option> < option value = "http://www.srcmini.com/Orange"> Orange< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Fruits< /div> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /div> < /div> < /div> < /div> < script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"> < /script> < script> // here initialize the appvar myApp = new Framework7 ({animateNavBackIcon:true}); // If your using custom DOM library, then save it to $$ variablevar $$ = Dom7; // Add the viewvar mainView = myApp.addView('.view-main', {// enable the dynamic navbar for this viewdynamicNavbar: true}); < /script> < /body> < /html>

立即测试
在选择器中打开示例
< !DOCTYPE html> < html> < head> < meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" /> < meta name = "apple-mobile-web-app-capable" content = "yes" /> < meta name = "apple-mobile-web-app-status-bar-style" content = "black" /> < title> Open in Picker< /title> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" /> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" /> < /head> < body> < div class = "views"> < div class = "view view-main"> < div class = "navbar"> < div class = "navbar-inner"> < div class = "left"> < /div> < div class = "center sliding"> Smart Select Open in Picker< /div> < div class = "right"> < /div> < /div> < /div> < div class = "pages navbar-through"> < div data-page = "home" class = "page"> < div class = "page-content"> < div class = "list-block"> < ul> < li> < a href = "http://www.srcmini.com/#" data-open-in = "picker" class = "item-link smart-select"> < select name = "countries"> < option value = "http://www.srcmini.com/India" selected> India< /option> < option value = "http://www.srcmini.com/Newz = Zealnad"> New Zealand< /option> < option value = "http://www.srcmini.com/Srilanka"> Srilanka< /option> < option value = "http://www.srcmini.com/WestIndies"> West Indies< /option> < option value = "http://www.srcmini.com/China"> China< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Countries< /div> < /div> < /div> < /a> < /li> < li> < a href = "http://www.srcmini.com/#" data-open-in = "picker" data-picker-close-text = "Close the List" class = "item-link smart-select"> < select name = "fruits"> < option value = "http://www.srcmini.com/Apple"> Apple< /option> < option value = "http://www.srcmini.com/Pineapple"> Pineapple< /option> < option value = "http://www.srcmini.com/Pear"> Pear< /option> < option value = "http://www.srcmini.com/Mango" selected> Mango< /option> < option value = "http://www.srcmini.com/Orange"> Orange< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Fruits< /div> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /div> < /div> < /div> < /div> < script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"> < /script> < script> // here initialize the appvar myApp = new Framework7 ({animateNavBackIcon:true}); // If your using custom DOM library, then save it to $$ variablevar $$ = Dom7; // Add the viewvar mainView = myApp.addView('.view-main', {// enable the dynamic navbar for this viewdynamicNavbar: true}); < /script> < /body> < /html>

立即测试
自定义图标, 颜色和图像示例
< !DOCTYPE html> < html> < head> < meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" /> < meta name = "apple-mobile-web-app-capable" content = "yes" /> < meta name = "apple-mobile-web-app-status-bar-style" content = "black" /> < title> Custom icons, colors and images< /title> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" /> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" /> < /head> < body> < div class = "views"> < div class = "view view-main"> < div class = "navbar"> < div class = "navbar-inner"> < div class = "left"> < /div> < div class = "center sliding"> Smart Select Custom Icons, Colors and Images< /div> < div class = "right"> < /div> < /div> < /div> < div class = "pages navbar-through"> < div data-page = "home" class = "page"> < div class = "page-content"> < div class = "list-block"> < ul> < li> < a href = "http://www.srcmini.com/#" class = "item-link smart-select"> < select name="fruits"> < option value="http://www.srcmini.com/apple" selected data-option-color="red"data-option-image="image source"> Apple< /option> < option value="http://www.srcmini.com/pineapple" data-option-color="yellow"data-option-image="image source"> Pineapple< /option> \< option value = "http://www.srcmini.com/Pear"data-option-color="yellow"data-option-image="image source"> Pear< /option> < option value = "http://www.srcmini.com/Mango"data-option-color="green"data-option-image="image source"> Mango< /option> < option value = "http://www.srcmini.com/Orange"data-option-color="orange"data-option-image="image source"> Orange< /option> < /select> < div class = "item-content"> < div class = "item-inner"> < div class = "item-title"> Fruits< /div> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /div> < /div> < /div> < /div> < script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"> < /script> < script> // here initialize the appvar myApp = new Framework7 ({animateNavBackIcon:true}); // If your using custom DOM library, then save it to $$ variablevar $$ = Dom7; // Add the viewvar mainView = myApp.addView('.view-main', {// enable the dynamic navbar for this viewdynamicNavbar: true}); < /script> < /body> < /html>

立即测试
多重选择和选择组示例
< !DOCTYPE html> < html> < head> < meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" /> < meta name = "apple-mobile-web-app-capable" content = "yes" /> < meta name = "apple-mobile-web-app-status-bar-style" content = "black" /> < title> Multiple Select and Optgroup< /title> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" /> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" /> < /head> < body> < div class = "views"> < div class = "view view-main"> < div class = "navbar"> < div class = "navbar-inner"> < div class = "left"> < /div> < div class = "center sliding"> Multiple Select and Optgroup< /div> < div class = "right"> < /div> < /div> < /div> < div class = "pages navbar-through"> < div data-page = "home" class = "page"> < div class = "page-content"> < div class = "list-block"> < ul> < li> < a href="http://www.srcmini.com/#" class="item-link smart-select"> < !-- "multiple" attribute for multiple select--> < select name="car" multiple> < !-- options grouped within "optgroup" tag--> < optgroup label="Japanese"> < option value="http://www.srcmini.com/honda" selected> Honda< /option> < option value="http://www.srcmini.com/lexus"> Lexus< /option> < option value="http://www.srcmini.com/mazda"> Mazda< /option> < option value="http://www.srcmini.com/nissan"> Nissan< /option> < option value="http://www.srcmini.com/toyota"> Toyota< /option> < /optgroup> < optgroup label="German"> < option value="http://www.srcmini.com/audi" selected> Audi< /option> < option value="http://www.srcmini.com/bmw"> BMW< /option> < option value="http://www.srcmini.com/mercedes"> Mercedes< /option> < option value="http://www.srcmini.com/vw"> Volkswagen< /option> < option value="http://www.srcmini.com/volvo"> Volvo< /option> < /optgroup> < optgroup label="American"> < option value="http://www.srcmini.com/cadillac"> Cadillac< /option> < option value="http://www.srcmini.com/chrysler"> Chrysler< /option> < option value="http://www.srcmini.com/dodge"> Dodge< /option> < option value="http://www.srcmini.com/ford" selected> Ford< /option> < /optgroup> < /select> < div class="item-content"> < div class="item-inner"> < div class="item-title"> Car< /div> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /div> < /div> < /div> < /div> < script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"> < /script> < script> // here initialize the appvar myApp = new Framework7 ({animateNavBackIcon:true}); // If your using custom DOM library, then save it to $$ variablevar $$ = Dom7; // Add the viewvar mainView = myApp.addView('.view-main', {// enable the dynamic navbar for this viewdynamicNavbar: true}); < /script> < /body> < /html>

立即测试
多选和最大长度示例通过使用maxlength属性, 它可以帮助你选择数量有限的项目。
在此示例中, maxlength为3。因此, 你最多可以选择3辆汽车。
< !DOCTYPE html> < html> < head> < meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" /> < meta name = "apple-mobile-web-app-capable" content = "yes" /> < meta name = "apple-mobile-web-app-status-bar-style" content = "black" /> < title> Multiple Select and Maxlength< /title> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" /> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" /> < /head> < body> < div class = "views"> < div class = "view view-main"> < div class = "navbar"> < div class = "navbar-inner"> < div class = "left"> < /div> < div class = "center sliding"> Multiple Select and Maxlength< /div> < div class = "right"> < /div> < /div> < /div> < div class = "pages navbar-through"> < div data-page = "home" class = "page"> < div class = "page-content"> < div class = "list-block"> < ul> < li> < a href = "http://www.srcmini.com/#" class = "item-link smart-select"> < select name="car" multiple maxlength="3"> < optgroup label="Japanese"> < option value="http://www.srcmini.com/honda" selected> Honda< /option> < option value="http://www.srcmini.com/lexus"> Lexus< /option> < option value="http://www.srcmini.com/mazda"> Mazda< /option> < option value="http://www.srcmini.com/nissan"> Nissan< /option> < option value="http://www.srcmini.com/toyota"> Toyota< /option> < /optgroup> < optgroup label="German"> < option value="http://www.srcmini.com/audi"> Audi< /option> < option value="http://www.srcmini.com/bmw"> BMW< /option> < option value="http://www.srcmini.com/mercedes"> Mercedes< /option> < option value="http://www.srcmini.com/vw"> Volkswagen< /option> < option value="http://www.srcmini.com/volvo"> Volvo< /option> < /optgroup> < optgroup label="American"> < option value="http://www.srcmini.com/cadillac"> Cadillac< /option> < option value="http://www.srcmini.com/chrysler"> Chrysler< /option> < option value="http://www.srcmini.com/dodge"> Dodge< /option> < option value="http://www.srcmini.com/ford"> Ford< /option> < /optgroup> < /select> < div class="item-content"> < div class="item-inner"> < div class="item-title"> Car< /div> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /a> < /li> < /ul> < /div> < /div> < /div> < /div> < /div> < /div> < script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"> < /script> < script> // here initialize the appvar myApp = new Framework7({animateNavBackIcon:true}); // If your using custom DOM library, then save it to $$ variablevar $$ = Dom7; // Add the viewvar mainView = myApp.addView('.view-main', {// enable the dynamic navbar for this viewdynamicNavbar: true}); < /script> < /body> < /html>

【Framework7智能选择】立即测试

    推荐阅读