Jiggle effect using CSS
Have you ever wondered how does the icons in your iPhone jiggle?
If yes here you can find out how. There have been many tricks to let it happen but the most easy one is using CSS,
ya you got me correct pure CSS. Below code snippet helps you display some awesome css effects.
If yes here you can find out how. There have been many tricks to let it happen but the most easy one is using CSS,
ya you got me correct pure CSS. Below code snippet helps you display some awesome css effects.
Click on the icon to start/stop jiggling !!!
Sometimes you might want your icon to start or stop jiggling on an event.
General case might be on clicking it, or on hovering or onload or many more...
So below script helps you to add/remove jiggle class on click event which would solve out your issue.
In case you want it on some other event just change the event type and you all set to go.
General case might be on clicking it, or on hovering or onload or many more...
So below script helps you to add/remove jiggle class on click event which would solve out your issue.
In case you want it on some other event just change the event type and you all set to go.
Script
- $(function() {
- $('.click-to-jiggle').click(function(e) {
- $(this).toggleClass('jiggle');
- return false;
- });
- });
So for jiggling you might need some icon images right.
This icons would be got using img tag and we will toggle a class for each img tag to jiggle it.
This icons would be got using img tag and we will toggle a class for each img tag to jiggle it.
HTML
- <img class="click-to-jiggle jiggle" src="blogger.png">
- <img class="click-to-jiggle jiggle" src="facebook.png">
- <img class="click-to-jiggle jiggle" src="linkedin.png">
- <img class="click-to-jiggle jiggle" src="youtube.png">
- <img class="click-to-jiggle jiggle" src="twitter.png">
Here comes the most crucial part...
The CSS, so there are some css styles attributes which are supported by some browser
and which might help you complete you task easily without much stress. Let's see
and which might help you complete you task easily without much stress. Let's see
CSS
- .jiggle {
- -webkit-animation: jiggle 0.2s infinite;
- -moz-animation-duration: 0.2s;
- -moz-animation-name: jiggle;
- -moz-animation-iteration-count: infinite;
- -webkit-transform: rotate(-3deg);
- -moz-transform: rotate(-3deg);
- }
- @-moz-keyframes jiggle {
- 0% {
- -moz-transform: rotate(-1deg);
- }
- 50% {
- -moz-transform: rotate(1deg);
- }
- }
- @-webkit-keyframes jiggle {
- 0% {
- -webkit-transform: rotate(-1deg);
- }
- 50% {
- -webkit-transform: rotate(1deg);
- }
- }
Circular Images using pure CSS
Below code snippet helps you change the image into circular one.
i.e. - Now-a-days most of websites shows the images or profile avatars in Circular format, you might be wondering how can this be done.
It's very simple and can be done just using pure css.
Here's how you can do it !!!
i.e. - Now-a-days most of websites shows the images or profile avatars in Circular format, you might be wondering how can this be done.
It's very simple and can be done just using pure css.
Here's how you can do it !!!
HTML
- <img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTgKBFpU1FHBwHrXk21RGsT8uMM05nEYrijpXWX2qGKdLciMiRmsUDIJsQZ5ibSp7QQJnA-6mPezV47SXyPKN4Vjt6qPceb1QsCGGGYSsk_vPmg-3aBPV1_daVU9dV3Qh3SYuW2m7jqA/s320/15.jpg">