基于Bootstrap的Material Design风格表单插件
Jquery Material Form Plugin是一款基于Bootstrap的Material Design风格的JQUERY表单插件。该表单通过自定义样式和jQuery来将Bootstrap的表单修改为扁平风格的表单,并带有浮动标签特效。
使用方法
使用该Material Design风格表单需要在页面中引入jquery,bootstrap相关文件和materialFormStyles.css、materialForm.js文件。
< link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" > < link rel = "stylesheet" href = "css/materialFormStyles.css" > < script src = "js/jquery.min.js" ></ script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js" ></ script > < script src = "js/materialForm.js" ></ script > |
HTML结构
该Material Design风格表单的HTML结构是固定的,你可以复制下面的代码。
< div class = "container" id = "formOutterWrapper" > < div class = "container" id = "formInnerWrapper" > < form id = "materialForm" class = "form" method = "post" action = "" role = "form" autocomplete = "off" > < div class = "form-group" > < div class = "col-xs-6" > < label class = "labels" for = "firstName" >用户名称</ label > < input type = "text" class = "formInput" id = "firstName" name = "firstName" > </ div > < div class = "col-xs-6" > < label class = "labels" for = "lastName" >昵 称</ label > < input type = "text" class = "formInput" id = "lastName" name = "lastName" > </ div > </ div > < div class = "form-group" > < div class = "col-xs-6" > < label class = "labels" for = "email" >电子邮件</ label > < input type = "text" class = "formInput" id = "email" name = "email" > </ div > < div class = "col-xs-6" > < label class = "labels" for = "phone" >联系电话</ label > < input type = "tel" class = "formInput" id = "phone" name = "phone" > </ div > </ div > < div class = "form-group" > < div class = "col-xs-12" > < label class = "labels" for = "description" >项目描述</ label > < input type = "text" class = "formInput" id = "description" name = "description" > </ div > </ div > < div class = "form-group" > < div class = "col-xs-12" > < button type = "button" class = "btn btn-primary green flatButton" id = "submit" >提交</ button > </ div > </ div > </ form > </ div > </ div > |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现