There are two ways to implement animations in CSS3, transition and [email protected].The mechanism of action is different: transition defines some CSS properties on the elements that might be animated , and then animates them once the CSS changes; animation is defined on the element that will be animated immediately . Once the animation is defined.For example, wh
CSS3 Transform, Transition, and Animation attribute summary, css3transition
Three attributes related to deformation and animation in CSS3:
Transform
Browser support:
Internet Explorer 10, Firefox, and Opera support the transform attribute.
Internet Explorer 9 supports alternative-ms-transform attributes (only applicable to 2D conversions ).
Safari and Chrome supp
Before CSS3, animations on a Web page were implemented by JavaScript, and in this era you might see such snippets of code:
SetTimeout (Funcntion () {document.getElementById ("Test"). Style.opacity + 0.1;}, 300)The above code fragment implements the transparency gradient for the content described by this ID.
This is more complex to write, and the maintainability is poor. In addition, the performance on the mobile side is also very urgent.
Talk about transition in CSS3.The transition of CSS3 in the standard is described as follows:CSS's transition allows the CSS's property values to smoothly transition within a certain time interval. This effect can be triggered by
This article mainly talks about the transition properties of CSS3.Transition properties are designed to be very easy to understand, the attribute is transition, there are four sub-attributes:
represents a property that needs to be transitioned "must" (essentially, transit
The CSS3 animation effect is often used in webapp reference development, so let's explore the use of this property together. Where do you define animation effects? CSS3 animations are typically defined by mouse events or state-of-the-states animations, usually by using mouse events in the pseudo-class and JS in CSS. JS events can also, such as click,focus,mousemove,mouseover,mouseout and so on Basic syntax
position with two parameters
Rotate (clockwise rotation angle (deg)) Rotation: angle can be negative, this means counterclockwise rotation
Scale (X-axis scaling, y-axis scaling): Zoom, 1 is constant, 0.5 is shrunk to half, and 2 is twice times
Skew (flip the horizontal flip angle (deg) along the x-axis: Flip the angle vertically along the y-axis (deg)) Note the difference between rotation and rollover
Matrix () This method puts all of the 2D conversion methods together, which in
The transition of CSS3 is described in the "CSS" transition allows the CSS property values to smoothly transition within a certain time interval. This effect can be triggered by clicking on the mouse , getting focus, being clicked, or any change to the element , and animating the CSS property values in a sleek and anim
1. A Scalable search Form
People who are always in the sf.gg know that the top navigation bar is this:
When the input box gets focus, it becomes this way:
Using the CSS3 Transition attribute, we can simply make a similar search form out of the list:
HTML Tags:
xml/html code to copy content to clipboard
header >
form action = method = "POST" class = "Searchfo
CSS3 Transition Detailed transition: [Transition-property] [transition-duration] [transition-timing-function] [Transition-delay]Introduction to the value of
Transition and animation two CSS3 properties are often used in real projects and want to sort them out.1. First introduce transition>>>>> A. In the project often encounter such a situation, such as a button, when the mouse moved into the revision button background color and font color. This is usually done outside:. BTN {width: 80px; height: 25px; border: 1px sol
Practical Use experience of CSS3 transition specificationsThis article mainly describes the CSS3 transition specification and differences in the use of different browsers. For more information about specific solutions or how to avoid problems, see another insightful article, "All You Need to Know About CSS Transitions
","Webkittransitionevent": "Webkittransitionend","Otransitionevent": "Otransitionend","Otransitionevent": "Otransitionend"};VAR ret;for (var name in obj) {try{var a = document.createevent (name);ret = Obj[name];Break}catch () {}}Gettransitionend = function () { //override this method only once and return the cached result directly the next time, this is called the lazy function. return ret;}return ret;}Finally, we use CSS transition to achieve an anim
Ellipsis: Displays the ellipsis to represent the trimmed text.
Additional property mates are required for the ellipsis effectp { width: 100px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}Worried about someone asking questions. The above code can only display ellipses in the first line, what if I want to show on the second or third line?The principle is that by pseudo ::after -elements to achieve is not very easy.Transitions and animationsCSS3 animations are
animation. The default value is normal, indicating that each animation is played forward. The other value is alternate. the even number of animations is played forward, and the odd number is played backward.
When writing the preceding attributes, you must add the prefix-WebKit-,-o-,-MS-,-moz-based on different browsers-
Additional links:
Http://www.w3cplus.com/content/css3-transform (Transform)
Http://www.cnblogs.com/lianjun/archive/2011/09
.
Ease-out: Specifies a transition effect (equal to Cubic-bezier (0,0,0.58,1)) that ends at a slow speed.
Ease-in-out: Specifies a transition effect (equal to Cubic-bezier (0.42,0,0.58,1)) that starts and ends at a slow speed.
Cubic-bezier (N,n,n,n): Defines its own value in the Cubic-bezier function. The possible values are numbers between 0 and 1.
Ii. examples LinearEaseEase-inEas
This article mainly introduces the transition of CSS3 and animation animation properties using the main points transition and animation can be used to make Basic page picture dynamic effect, of course, further control or need JavaScript help, A friend you need can refer to the following
Transition (excessive)
1, browser support situationTransformTransitionAnimation2. Describe their usage separately.The Transform property applies a 2D or 3D conversion to an element. This property allows us to rotate, scale, move, or skew elements, which can change the shape of an element.Syntax for transform:none| transform-functions;For specific methods seeCSS3 Transform properties on W3cschoolThe Transition property is a shorthand property for setting four
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.