copy click animation

This commit is contained in:
Sriram Hariharan
2019-01-14 20:16:22 -06:00
parent 0cdcc32b5c
commit 649255d628
2 changed files with 8 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ body {
outline: 0; outline: 0;
} }
.noshadow { .shadow {
box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(0, 0, 0, 0.16); box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(0, 0, 0, 0.16);
} }

View File

@@ -121,20 +121,23 @@ $(document).ready(function () {
$("#courseList").on('mouseover', '.copybut', function () { $("#courseList").on('mouseover', '.copybut', function () {
$(this).addClass('noshadow'); $(this).addClass('shadow');
}).on('mouseleave', '.copybut', function () { }).on('mouseleave', '.copybut', function () {
$(this).removeClass('noshadow'); $(this).removeClass('shadow');
}); });
$("#courseList").on('click', '.copybut', function (e) { $("#courseList").on('click', '.copybut', function (e) {
e.stopPropagation(); e.stopPropagation();
var temp = $("<input>"); var temp = $("<input>");
$(this).find('i').text('check'); $(this).find('i').text('check');
$(this).stop(true, false).removeAttr('style').removeClass('noshadow', { $(this).stop(true, false).removeAttr('style').removeClass('shadow', {
duration: 200 duration: 200
}); });
$(this).find('i').delay(400).queue(function (n) { $(this).find('i').delay(400).queue(function (n) {
$(this).text('content_copy'); $(this).text('content_copy');
$(this).parent().addClass('noshadow'); $(this).parent().removeClass('shadow');
if ($(this).parent().is(":hover")) {
$(this).parent().addClass('shadow');
}
n(); n();
}) })