In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge of "how to achieve the shutter effect in Html5". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. The shutter layout is overlaid on top of the content layout with positioning (position: absolute), and the background is set to transparent (background-color: transparent).
2Magnekeyframes define fade in and out (transparency change) and louver effect animation.
3. Start the animation by setting the className property of DOM. Animator.className = 'baiyeWindow'; listens for animation completion event' animationend', to clear the className attribute.
4. In the event of content layout switching, call the start animation method. Both layouts need to bind the switching event ng-click= "switchLayout ()".
5. Sequence diagram of animation execution:
Html Code:
...
Css style Code:
/ / talk about the results. Fade-animation {@-webkit-keyframes fadeInOut {0% {opacity: 1;} 50% {opacity: 0;} 100% {opacity: 1;} @ keyframes fadeInOut {0% {opacity: 1 } 50% {opacity: 0;} 100% {opacity: 1;}} animation: fadeInOut 1s ease-in;-webkit-animation: fadeInOut 1s ease-in;} / / louver effect. BaiyeWindow {width: 100%; height: 1.68rem Position: absolute; left: 0; top: 1.2 remt; li {height: 0.42 remt; line-height: 40px; overflow: hidden; background-color: transparent; .ye {- webkit-animation: slideOut 1s ease-in-out; animation: slideOut 1s ease-in-out; width: 100% Background-color: rgba; position: relative; top: 50%;}} @-webkit-keyframes slideOut {0% {padding-bottom: 0; top: 50%;} 100% {padding-bottom: 40px; top: 0 } @ keyframes slideOut {0% {padding-bottom: 0; top: 50%;} 100% {padding-bottom: 40px; top: 0;}
JS Code:
/ / switch layout $scope.switchLayout = function () {... $scope.startBaiYeWindow (); / / after starting the animation 0.5s, control the layout to show / hide $timeout (function () {if ($scope.show) {$scope.show = false;} else {.... / / start the animation $scope.startBaiYeWindow = function () {var animator = document.getElementById ('baiyeWindow'); var animatorFadeInOut = document.getElementById (' fadeInOut'); animator.addEventListener ('animationend', function () {animator.className =''; animatorFadeInOut.className = 'content';})) $timeout (function () {animator.className = 'baiyeWindow'; animatorFadeInOut.className =' content fade-animation';}, 0);}; "how to achieve the shutter effect in Html5" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.