时间:2021-07-01 10:21:17 帮助过:45人阅读
在线预览 源码下载
使用该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>
该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>
该表单插件的github地址为:https://github.com/ch0chi/Jquery-Material-Form-Plugin
在线预览 源码下载