» » 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: 15590

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
10 August 2017 18:28

Michel Jhon

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Which can give good results short-term, and yet it’s not really plausible long-term method for the purpose of blokes who would like to turn out to be repair a particular wonderful person many can’t give up enthusiastic about. https://onmogul.com/stories/lurn-summit-review-does-it-really-work

<
  • 0 Comments
  • 0 Articles
15 August 2017 01:29

vipseo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Very good written article. It will be supportive to anyone who utilizes it, including me. Keep doing what you are doing – can’r wait to read more posts. state-of-the-art and unique training platform which will enable you to trade and earn everyday.

<
  • 0 Comments
  • 0 Articles
16 August 2017 00:34

Gabby Wright

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Which can give good results short-term, and yet it’s not really plausible long-term method for the purpose of blokes who would like to turn out to be repair a particular wonderful person many can’t give up enthusiastic about. http://www.ansonhistoric.org/activox-daily-review/

<
  • 0 Comments
  • 0 Articles
18 August 2017 18:55

vipseo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
You’ve got some interesting points in this article. I would have never considered any of these if I didn’t come across this. Thanks!. free embroidery designs to download

<
  • 0 Comments
  • 0 Articles
20 August 2017 19:34

Denica Suarez

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Their work you will is amazingly readily shown ınside your blog articles; you may be an actual competent. I would prefer to supply an extra blog with the preferred varieties one shown yesterday morning. Require ones own people to look into online world.for a lot of stuff tailor-made article. jual HP Spectre

<
  • 0 Comments
  • 0 Articles
21 August 2017 23:28

v

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. online cake delivery in Bhopal

<
  • 0 Comments
  • 0 Articles
22 August 2017 23:42

Gabby Wright

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Your site has grown a one-stop find as much as possible tutorial authoring. Thanks for your time in the very good get the job done. As i tested the online sites one preferred and even On the net which will best-dissertation.pores and skin look though. Ones own get the job done is kind of exemplary. german escalera

Checking any blog may make others just want to come up with a greater number of. I did a fabulous which i was first lovely content by means of. The software most likely conducted for the tier still it’s exceptional. I often dispatch you xì gà cuba

<
  • 0 Comments
  • 0 Articles
24 August 2017 21:22

jamesjack

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
This post is very simple to read and appreciate without leaving any details out. Great work! upcoming icos

<
  • 0 Comments
  • 0 Articles
25 August 2017 21:11

vipseo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
The website is looking bit flashy and it catches the visitors eyes. Design is pretty simple and a good user friendly interface. Phentermine Slim

<
  • 0 Comments
  • 0 Articles
28 August 2017 00:08

vipseo

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 and glad I found this thing in you post. Thanks Quick Weight Loss Tips 2017

<
  • 0 Comments
  • 0 Articles
28 August 2017 23:06

morning world

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share. Slimming Diet Pills

<
  • 0 Comments
  • 0 Articles
29 August 2017 18:26

vipseo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. cheap digitizing services

It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. Thanks for sharing. www.lottospielen24.org

<
  • 0 Comments
  • 0 Articles
30 August 2017 21:01

morning world

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Fantastic blog! Do you have any tips and hints for aspiring writers? I’m planning to start my own website soon but I’m a little lost on everything. Would you propose starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m completely overwhelmed .. Any suggestions? Many thanks! https://www.lottospielen24.org/

<
  • 0 Comments
  • 0 Articles
31 August 2017 00:00

morning world

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
No doubt this is an excellent post I got a lot of knowledge after reading good luck. Theme of blog is excellent there is almost everything to read, Brilliant post. about weight loss

<
  • 0 Comments
  • 0 Articles
31 August 2017 13:54

vipseo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. buy modafinil with bitcoin

<
  • 0 Comments
  • 0 Articles
1 September 2017 01:38

vipseo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Interesting and amazing how your post is! It Is Useful and helpful for me That I like it very much, and I am looking forward to Hearing from your next.. Church & Shuter Condos

<
  • 0 Comments
  • 0 Articles
1 September 2017 23:04

uzmamir79

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="https://herpes-no.com/en/cure-for-herpes/">zoster virus</a>

<
  • 0 Comments
  • 0 Articles
4 September 2017 21:57

morning world

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. https://www.lottospielen24.org/

Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. [ur=https://www.youtube.com/watch?v=Gb8AKUbvshc]nutrisystem d plan[/url]

I have bookmarked your blog, the articles are way better than other similar blogs.. thanks for a great blog! appetite suppressant 2017

<
  • 0 Comments
  • 0 Articles
5 September 2017 18:47

morning world

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging.. www.lottospielen24.org

<
  • 0 Comments
  • 0 Articles
6 September 2017 20:14

v

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I think this is one of the most significant information for me. And i’m glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really great : D. Good job, cheers Twitter

<
  • 0 Comments
  • 0 Articles
8 September 2017 22:31

osama nawaz

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share. <a href="http://jewelatbuangkok.net/floor-plans/">Rivercove Residences EC</a>

<
  • 0 Comments
  • 0 Articles
10 September 2017 19:01

vipseo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks iOS

I just want to let you know that I just check out your site and I find it very interesting and informative.. costa blanca property for sale

<
  • 0 Comments
  • 0 Articles
11 September 2017 19:44

osama nawaz

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
thanks this is good blog.plant protein

I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. best diet pills that work

<
  • 0 Comments
  • 0 Articles
11 September 2017 22:31

v

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Thanks for providing recent updates regarding the concern, I look forward to read more. Investigation agency

<
  • 0 Comments
  • 0 Articles
12 September 2017 18:01

vipseo

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Great knowledge, do anyone mind merely reference back to it li kung 14 day liver detox

<
  • 0 Comments
  • 0 Articles
12 September 2017 20:01

osama nawaz

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
very interesting keep posting.SEO

<
  • 0 Comments
  • 0 Articles
12 September 2017 22:09

v

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post! http://www.ansonhistoric.org/li-kung-14-day-liver-detox-review/

<
  • 0 Comments
  • 0 Articles
13 September 2017 21:27

v

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. costa del sol property for sale

very interesting keep posting. best fat burners 2016

<
  • 0 Comments
  • 0 Articles
14 September 2017 04:46

v

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! Nim Collection

<
  • 0 Comments
  • 0 Articles
14 September 2017 23:08

v

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! Painel Solar

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