» » Pure CSS3 to realize rotation effect of icon

 

Pure CSS3 to realize rotation effect of icon

Author: bamboo06 on 17-02-2016, 00:44, views: 15559

76
CSS3 has a transform, which can make the target object deformation, transformation, change. Applied to the need to convert the angle, changing the size and other scenes, such as icons rotate, zoom in and out the background, etc., in short, transform is deformed, change the meaning, it belongs to the advanced technology of CSS3.


Examples of this paper, we give a brief transform common application, that is, when we slide icon with the mouse button, the icon will automatically rotate a week, this effect does not rely JS, css3 of the transform can be completed.
Transform Introduction
In CSS3 transform include the following: a rotating rotate, distort skew, scale and move the zoom and translate matrix deformation matrix.
1, the rotation rotate (): by specifying parameters on the angle of the original elements of a 2D rotation (2D rotation), angle refers to the angle of rotation, if the setting is a positive number represents clockwise rotation, a negative number indicates counterclockwise rotation. Such as: transform: rotate (30deg).
2, twisted skew ([,]): skew X-axis Y-axis transformation (miter conversion). The first parameter corresponds to the X-axis, Y-axis corresponds to the second parameter. If the second argument is not provided, the value is 0, that is, no miter on the Y-axis direction. skew is used to distort the line elements, the first parameter is the twist angle in the horizontal direction, and the second parameter is the twist angle in the vertical direction. Wherein the second parameter is optional and defaults to 0deg.
3, Zoom scale ([,]): provides instructions for performing [sx, sy] scaling vector two parameters specify a 2D scale (2D scaling). If the second argument is not provided, then take the same value as the first parameter. scale (X, Y) is used for the element to zoom, you can transform-origin to point set of elements, elements of the same point in a central location; group X represents a multiple of horizontal scaling, Y represents the vertical zoom ratio and Y is an optional parameter, if the Y value is not set, then zoom ratio X, Y is the same in both directions. And X prevail. Such as: transform: scale (2,1.5).
4, the mobile translate ([,]): specified by the vector [tx, ty] a 2D translation, tx is the first transition parameter, ty is the second transition parameter options. If it is not provided, ty 0 as its value. That is translate (x, y), which represents an object pan, according to the set x, y parameter value, when value is negative, the opposite direction of moving objects, which defaults to the element center point can also be based transform-origin changes basis points. Such as transform: translate (100px, 20px).
5, matrix deformation matrix (,,,,,): in the form of a six-containing values ​​(a, b, c, d, e, f) specifies a 2D transformation matrix transformation, the equivalent of a direct application of [abcdef] conversion matrix. Is based on the horizontal direction (X axis) and vertical (Y-axis) repositioning elements, this attribute value relates to the use of a matrix mathematics.

Example: rotation icon
To rotate the icon, just use the rotate transform and transition animation effect to complete rotation. In this case, we are ready to two pictures as a background image when the mouse slide icon, icons do 360 degree rotation motion, html structure is as follows:
<ul class="icos">
	<li class="female"><a href="#"><i></i>Female</a></li>
	<li class="arrow"><a href="#"><i></i>Arrow</a></li>
</ul>

Use CSS3 to complete the connection with the following icons rotation effect.
ul { width: 145px; margin: 0 auto; list-style: none; font-size: 30px; } 
li{padding:10px } 
li a{width:145px;height:42px;line-height:36px;display:block;color:#333} 
li a:hover{text-decoration:none} 
li a i { background: url(icon.png) no-repeat; display: block; width: 42px; height: 32px; position: relative; z-index: 10; float:left; 
    -webkit-transition: -webkit-transform 0.4s ease-out; 
    -moz-transition: -moz-transform 0.4s ease-out; 
    transition: transform 0.4s ease-out; 
} 
li a:hover i { 
    -webkit-transform: rotate(360deg); 
    -moz-transform: rotate(360deg); 
    transform: rotate(360deg); 
} 
 
li.female a i { background-position: 0 0; } 
li.arrow a i { background-position: 0 -50px; } 

Category: CSS

Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.
<
  • 0 Comments
  • 0 Articles
20 November 2017 21:46

Phen375 review

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Only aspire to mention ones content can be as incredible. This clarity with your post is superb and that i may think you’re a guru for this issue. High-quality along with your concur permit me to to seize your current give to keep modified by using approaching blog post. Thanks a lot hundreds of along with you should go on the pleasurable get the job done. Phen375 review

<
  • 0 Comments
  • 0 Articles
21 November 2017 03:30

sohail khatri

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I would like to say that this blog really convinced me to do it! Thanks, very good post. hampton bay ceiling fans

<
  • 0 Comments
  • 0 Articles
21 November 2017 21:35

ali abbas

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. <a href="https://www.icoranker.com">UPCOMING ICOS</a>

Nice blog, I will keep visiting this blog very often. <a href="https://orbitbeam.net/">website development company</a>

<
  • 0 Comments
  • 0 Articles
28 November 2017 22:02

sohail khatri

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
This is actually the kind of information I have been trying to find. Thank you for writing this information.connectmath

<
  • 0 Comments
  • 0 Articles
3 December 2017 21:13

aliya

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
When you use a genuine service, you will be able to provide instructions, share materials and choose the formatting style. <a href="http://www.riodica.com/">loja de informatica</a>

<
  • 0 Comments
  • 0 Articles
4 December 2017 17:12

aliya

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. <a href="http://www.easybibleverses.com/who-is-jesus-christ-according-to-the-b
ible/">who is jesus in the bible</a>

<
  • 0 Comments
  • 0 Articles
8 December 2017 20:16

jonson

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I’ve been searching for some decent stuff on the subject and haven't had any luck up until this point, You just got a new biggest fan!.. <a href="http://southbeachsingles.ning.com/profiles/blogs/finest-breast-enlarg
ement-pills">Best Breast Enlargement Pills</a>

I’ve been searching for some decent stuff on the subject and haven't had any luck up until this point, You just got a new biggest fan!.. Best Breast Enlargement Pills

<
  • 0 Comments
  • 0 Articles
10 December 2017 19:18

Anna Sally

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.
Is Anton Antipov On Steroids Or Is He Natural?

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. <a href="https://www.fiverr.com/s2/1fa4e31042">logo design Amazing</a>

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. <a href="https://www.fiverr.com/s2/1fa4e31042">logo design Amazing</a>

<
  • 0 Comments
  • 0 Articles
17 December 2017 20:37

talha

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
This particular papers fabulous, and My spouse and i enjoy each of the perform that you have placed into this. I’m sure that you will be making a really useful place. I has been additionally pleased. Good perform! <a href="https://easycar.lt/">automobiliu nuoma Vilniuje</a>

<
  • 0 Comments
  • 0 Articles
29 January 2018 04:24

portable solar panels

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I really like the dear information you offer in your articles. I'm able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone else!
portable solar panels

<
  • 0 Comments
  • 0 Articles
7 February 2018 23:07

osama nawaz

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. <a href="http://nutritionalpetfood.com/best-vet-recommended-dog-food">
healthy cat food</a>

<
  • 1 Comment
  • 0 Articles
21 February 2018 23:14

rimsha

Reply
  • Group: Members
  • РRegistered date: 21.02.2018
  • Status: Currently Offline
 
Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.
Soft Story Retrofitters Los Angeles

<
  • 0 Comments
  • 0 Articles
25 February 2018 21:49

davidmiller

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work.
online fraud detection service

<
  • 0 Comments
  • 0 Articles
3 March 2018 03:24

cassikeeran

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
It's a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme? Fantastic work!
widget currency converter

<
  • 0 Comments
  • 0 Articles
3 March 2018 22:58

ConnerSeo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! search engine optimization Springfield mo

<
  • 0 Comments
  • 0 Articles
5 March 2018 22:32

ConnerSeo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing. Car Equity Loans Hollywood

Previous Next
Information
Comment on the news site is possible only within (days) days from the date of publication.