-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (32 loc) · 994 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Button
$(document).ready(function () {
var $button = $('#button');
var $form = $('#the-form');
var $emailinput = $('#email');
var $emaillabel = $('#email-label');
var $submit = $('#submit-btn');
$button.on('click', function (event) {
$button.addClass('fadeOut');
});
$button.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
$button.addClass('hide');
$form.removeClass('hide');
$form.addClass('fadeIn');
});
$emailinput.on('focus', function (event) {
$emaillabel.addClass('active');
});
$emailinput.on('blur', function (event) {
if ($emailinput.val().trim() == "") {
$emaillabel.removeClass('active');
}
});
$emailinput.on('keyup', function (event) {
if (event.target.value.length > 0) {
$submit.removeClass('hide');
}
else {
$submit.addClass('hide');
}
});
});