JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.js"></script>
<script src="http://thecodeplayer.com/uploads/js/jquery.easing.min.js"></script>
<form id="msform" action="" method="POST">
<!-- progressbar -->
<ul id="progressbar">
<li class="active">Upload Video Lecture</li>
<li>Upload Lecture Notes</li>
<li>Upload Screenshot</li>
</ul>
<!-- fieldsets -->
<fieldset>
<h2 class="fs-title">Upload Video Lecture</h2>
<div id="form">
<input type="file" name="videoFile" />
<input type="text" name="videoTitle" placeholder="Video Lecture Title" required />
<textarea name="videoDescription" rows="6" placeholder="Description" required></textarea>
</div>
<input type="button" name="next" class="next action-button" value="Upload" />
</fieldset>
<fieldset>
<h2 class="fs-title">Upload Lecture Notes</h2>
<div id="form">
<input type="file" name="notesFile" />
<input type="text" name="notesTitle" placeholder="Lecture Notes Title" />
<textarea name="notesDescription" rows="6" placeholder="Description"></textarea>
</div>
<input type="button" name="previous" class="previous action-button" value="Previous" />
<input type="button" name="next" class="next action-button" value="Upload" />
</fieldset>
</form>
CSS
/*custom font*/
@import url(http://fonts.googleapis.com/css?family=Montserrat);
/*basic reset*/
* {margin: 0; padding: 0;}
body {
height: 100%;
/*Image only BG fallback*/
background: url(images/geometry.png);
font-family: montserrat, arial, verdana;
font-size: 13px;
}
/* Header */
#header {
width: 1200px;
margin: 0 auto;
height: 10px;
}
#logo {
width: 1200px;
height: 0px; /* top navigation bar position */
margin: 0 auto;
padding: 0px;
}
#logo h1 {
float: left;
margin: 0;
color: #000000;
margin-top: 0;
text-transform: uppercase;
color: #528DC8;
padding: 5px 0 0 0;
letter-spacing: -1px;
text-transform: uppercase;
font-weight: normal;
font-size: 2.5em;
}
#logo p {
float: left;
margin: 0;
color: #000000;
text-transform: lowercase;
padding: 23px 0 0 10px;
font-size: 12px;
color: #000000;
}
#logo span {
color: #000000;
text-transform: uppercase;
}
/* Menu */
#menu {
margin: 0px auto;
padding: 0px;
height: 53px;
}
#menu ul {
margin: 0px;
padding: 0px;
list-style: none;
float: right;
}
#menu li {
display: inline;
}
#menu a {
display: block;
float: left;
height: 33px;
font-weight: normal;
margin: 0px;
padding: 19px 30px 0px 30px;
text-decoration: none;
text-transform: capitalize;
background: url(images/img03.jpg) no-repeat right 50%;
font-size: 1.1em;
color: #528DC8;
}
#menu a:hover {
color: #000000;
}
/* Form Styles */
#msform {
width: 600px;
margin: 50px auto;
text-align: center;
position: relative;
}
#msform fieldset {
background: white;
border: 0 none;
border-radius: 3px;
box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4);
padding: 20px 30px;
box-sizing: border-box;
width: 80%;
margin: 0 10%;
/* stacking fieldsets above each other */
position: absolute;
}
/* Hide all except first fieldset */
#msform fieldset:not(:first-of-type) {
display: none;
}
/* Inputs */
#msform input, #msform textarea {
padding: 15px;
border: 1px solid...
JavaScript
$(document).ready(function () {
var current_fs, next_fs, previous_fs; //fieldsets
var left, opacity, scale; //fieldset properties which we will animate
var animating; //flag to prevent quick multi-click glitches
$(".next").click(function () {
$('#msform').validate({
rules: {
videoFile: {
required: true,
extension:'mov|mp4|mpeg|wmv'
},
videoTitle: {
required: true,
},
videoDescription: {
required: true,
}
},
messages: {
videoFile: "Please specify a file",
videoTitle: "Title is required",
videoDescription: "Description is required"
}
});
if ((!$('#msform').valid())) {
return false;
}
if (animating) return false;
animating = true;
current_fs = $(this).parent(); //fieldset
next_fs = $(this).parent().next(); //next fieldset
//activate next step on progressbar using the index of next_fs
$("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active");
//show the next fieldset
next_fs.show();
//hide the current fieldset with style
current_fs.animate({
opacity: 0
}, {
step: function (now, mx) {
//as the opacity of current_fs reduces to 0 - stored in "now"
//1. scale current_fs down to 80%
scale = 1 - (1 - now) * 0.2;
//2. bring next_fs from the right(50%)
left = (now * 50) + "%";
//3. increase opacity of next_fs to 1 as it moves in
opacity = 1 - now;
current_fs.css({
'transform': 'scale(' + scale + ')'
});
next_fs.css({
'left': left,
'opacity': opacity
});
},
duration: 800,
complete: function () {
...