Build Online Store! | Penguin Panda Series - New! | 4 Rules To Make Money | SEO Settings | Facebook Popup 1, 2, 3 | Mashable 1 , 2


Saturday, June 18, 2011

Rotate/Animate Images Using CSS3 Without JavaScript!


Pin It

animated imageCSS3 has many new powers with which we can further enhance our websites, without extensive knowledge of JavaScript, or without really effecting our website’s loading time. With less than ten lines of CSS coding, we can achieve each of the following effects.  Changing CSS properties on mouse-hover and using CSS3 transitions were used for these enhancements. You can now easily animate the images on your WordPress or Blogger blogs using the simple image opacity effect below that rotates the image on mouse hover.

Live Demo

 

Note: You need a up to date browser to fully experience the effects. This includes pretty much the latest version of any browser other than IE.

Animating Images In Blogger With CSS3

  1. Go To Blogger > Design > Edit HTML
  2. Backup your template
  3. Search for ]]></b:skin>
  4. Just above it paste the following code

 

/* --------- MBT Image Rotation ----- */
.opacity  {
opacity: 0.5;
margin-left: 50px;
-moz-transition: all 0.5s ease-out;  
-o-transition: all 0.5s ease-out;  
-webkit-transition: all 0.5s ease-out;  
-ms-transition: all 0.5s ease-out;  
transition: all 0.5s ease-out;
-moz-transform: rotate(5deg);  
-o-transform: rotate(5deg);  
-webkit-transform: rotate(5deg);  
-ms-transform: rotate(5deg);  
transform: rotate(5deg);  
filter: progid:DXImageTransform.Microsoft.Matrix(
                    M11=0.9961946980917455, M12=-0.08715574274765817, M21=0.08715574274765817, M22=0.9961946980917455, sizingMethod='auto expand');
zoom: 1;  
}
.opacity:hover  {
opacity: 1;
margin-left: 0px;
-moz-transform: rotate(0deg);  
-o-transform: rotate(0deg);  
-webkit-transform: rotate(0deg);  
-ms-transform: rotate(0deg);  
transform: rotate(0deg);  
filter: progid:DXImageTransform.Microsoft.Matrix(
                    M11=1, M12=0, M21=0, M22=1, sizingMethod='auto expand');
zoom: 1.3;
-moz-box-shadow: 1px 1px 4px #000;
-webkit-box-shadow: 1px 1px 4px #000;
box-shadow: 1px 1px 4px #000;
}

Edit the bolded values to increase or decrease the angle of rotation.   

5. Save your template and done!

How it works?

Whenever you wish to implement this effect, simply add the following code in Edit HTML mode of your Post Editor, to turn or rotate the images:

<img src="IMAGE LINK HERE" border="0" alt="Image Description hereclass="opacity" />

Make these changes:

  • Replace IMAGE LINK HERE with the Image URL of the pic
  • Replace Image Description here with Image name or description. Optional


We hope you enjoyed the effect, and happy blogging! Peace!

You may also like these effects:

Anims


About the Guest Author:

Anims is freelance web designer and enjoys playing around with and learning coding in his free time. He likes to write about Web Technologies such as HTML, CSS and SEO. He is a valuable MBT contributor.


If you enjoyed this post and wish to be informed whenever a new post is published, then make sure you Subscribe to our regular Email Updates!

If you don't want to get yourself into Serious Technical Trouble while editing your Blog Template then just sit back and relax and let us do the Job for you at a fairly reasonable cost. Submit your order details by Clicking Here »


Thanks for making this possible! Kindly Bookmark and Share it.
Technorati Digg This Stumble Facebook Twitter

4 comments:

Comment Page :
Akang Surya on 6:43 PM, June 19, 2011 said... #

thank you mr muhammad mustof thank God I've tried it and succeeded, although I failed a few times but finally succeeded. Thank you very much

Mohammad Mustafa Ahmedzai on 3:15 PM, June 20, 2011 said... #

@akang


We are glad buddy that it worked for you. All credits goes to anims for this. :)

Beauty Confetti on 5:54 AM, October 12, 2011 said... #

Hi Mohammad

The code works fine, but I wish there was room for another link besides the URL, so you could click through to another blog-post via the image.

Is it something you know how to add???

Thanx so much in advance! :)

Lai Pham Duy Hao on 10:43 PM, December 15, 2011 said... #

Nice, thank :D

Confused? Feel free to ask

Your feedback is always appreciated. We will try to reply to your queries as soon as time allows.

Note:
1. To add HTML CODE in comments then please use our HTML Encoder
2. You can always Test the tutorial on our HTML Editor
3. Please do not spam Spam comments will be deleted immediately upon our review.

Regards,
Mohammad

 

Recent Posts

Join Me On Facebook

8600+ Followers

Join The Team!

Licensed Under CC

Recent Comments

Follow Me On Twitter

2601+ Followers

My Blogger Tricks (MBT) © 2012. All Rights Reserved | Contact |