Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Progressive button on login"
Bootstrap 3.1.0 Snippet by
ajbm6
3.1.0
jQuery
login
Preview
HTML
CSS
JS
View Full Screen
Forked from
Fork
Fork this
Parent
822
 
0 Fav
Post to Facebook
Tweet this
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <button class="btn btn-primary" data-toggle="modal" data-target="#myModal"> Log in </button> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">Log in</h4> </div> <!-- /.modal-header --> <div class="modal-body"> <form role="form"> <div class="form-group"> <div class="input-group"> <input type="text" class="form-control" id="uLogin" placeholder="Login"> <label for="uLogin" class="input-group-addon glyphicon glyphicon-user"></label> </div> </div> <!-- /.form-group --> <div class="form-group"> <div class="input-group"> <input type="password" class="form-control" id="uPassword" placeholder="Password"> <label for="uPassword" class="input-group-addon glyphicon glyphicon-lock"></label> </div> <!-- /.input-group --> </div> <!-- /.form-group --> <div class="checkbox"> <label> <input type="checkbox"> Remember me </label> </div> <!-- /.checkbox --> </form> </div> <!-- /.modal-body --> <div class="modal-footer"> <button class="form-control btn btn-primary">Ok</button> <div class="progress"> <div class="progress-bar progress-bar-primary" role="progressbar" aria-valuenow="1" aria-valuemin="1" aria-valuemax="100" style="width: 0%;"> <span class="sr-only">progress</span> </div> </div> </div> <!-- /.modal-footer --> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal -->
body{ padding: 50px; } .modal-dialog { width: 300px; } .modal-footer { height: 70px; margin: 0; } .modal-footer .btn { font-weight: bold; } .modal-footer .progress { display: none; height: 32px; margin: 0; } .input-group-addon { color: #fff; background: #3276B1; }
$(document).ready(function() { $('.modal-footer button').click(function() { e.preventDefault(); var user = $('#username').val(); var pass = $('#password').val(); var button = $(this); if (button.attr("data-dismiss") != "modal") { var inputs = $('form input'); var title = $('.modal-title'); var progress = $('.progress'); var progressBar = $('.progress-bar'); button.hide(); $('.progress').show(); $('.progress-bar') .animate({ width : "100%" }, 100); $('.progress') .delay(1000) .fadeOut(600); button.text("Close") .removeClass("btn-primary") .addClass("btn-success") .blur() .delay(1600) .fadeIn(function() { title.text("Log in is successful"); button.attr("data-dismiss", "modal"); }); } }); $('#myModal').on('hidden.bs.modal', function (e) { var inputs = $('form input'); var title = $('.modal-title'); var progressBar = $('.progress-bar'); var button = $('.modal-footer button'); inputs.removeAttr("disabled"); title.text("Log in"); progressBar.css({ "width" : "0%" }); button.removeClass("btn-success") .addClass("btn-primary") .text("Ok") .removeAttr("data-dismiss"); }); });
Related:
See More
Free Template
Paper Kit
54.7K
24
Hexa shape button
462.1K
45
login-form
170.4K
18
Login Form
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76