[script] 화면 전환 시 페이드 (로딩 시 부드럽게 화면 전환)
Tip/Web
2017. 11. 8.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <script> jQuery(function($) { $("body").css("display", "none"); $("body").fadeIn(2000); $("a.transition").click(function(event){ event.preventDefault(); linkLocation = this.href; $("body").fadeOut(1000, redirectPage); }); function redirectPage() { window.location = linkLocation; } }); </script> | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | body{ animation: fadein 2000ms ease-out; -moz-animation: fadein 2000ms ease-out; /* Firefox */ -webkit-animation: fadein 2000ms ease-out; /* Safari and Chrome */ -o-animation: fadein 2000ms ease-out; /* Opera */ } @keyframes fadein { from {opacity:0;} to {opacity:1;} } @-moz-keyframes fadein { /* Firefox */ from {opacity:0;} to {opacity:1;} } @-webkit-keyframes fadein { /* Safari and Chrome */ from {opacity:0;} to {opacity:1;} } @-o-keyframes fadein { /* Opera */ from {opacity:0;} to {opacity: 1;} } | cs |
728x90
반응형