Make cookie notice animation code more efficient

Try to set position back to original value when cookie notice is hidden
This commit is contained in:
Matthew Grove
2018-11-17 17:44:41 +00:00
parent ca346b5202
commit f16ae9549f
2 changed files with 5 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ body {
background: --mdc-theme-primary;
color: --mdc-theme-background;
text-align: center;
bottom: 0;
bottom: -100;
left: 0;
z-index: 9999;
}

View File

@@ -40,9 +40,11 @@ $(document).ready(function(){
$(".source-code-link").animate({bottom: "+100px"}, 1000);
$("#close-cookies").click(function(){
event.preventDefault();
$("#cookies").animate({bottom: "0px"}, 1000);
// $("#cookies").animate({bottom: "0px"}, 1000);
$("#cookies").removeAttr("style");
$("#cookies").hide();
$(".source-code-link").animate({bottom: "0px"}, 1000);
$(".source-code-link").removeAttr("style");
// $(".source-code-link").animate({bottom: "0px"}, 1000);
Cookies.set("demo.matthew-grove.ml-cookies-accepted", "true", {expires: 30});
});
});