11. March 2009 by Janko in Tutorials | tags: ,

 

If you use Skype I am sure that you noticed that animated button for adding more people to a chat. When you click on it the icon on the left "jumps" for a few times. I love that animation. And that's why I'm going to show you how to create the same button using jQuery and some simple CSS.

Download source View demo

If you are not sure what button am I talking about, image below might help you.

 

And this is how our button will look like:

Ok, the task here is quite simple - I want the icon to jump for a few times when I hover the button. (In Skype window this icon jumps when you click on it, but I think it would be much better to have it jump on hover)

The button itself consist of an image and text placed inside of a link.

<a class="button" href="#">
    <img src="button.png" alt="" />Send info</a>
    or <a href="#">cancel</a>

Let's style the button. CSS code for this is simple and won't go through all the classes here. The key is that the icon is absolutely positioned inside its relatively positioned container - the link. The position of the icon is set to simulate Skype button, and that is to cover the left side of the button. Please note that you will see the rounded corners on the button only in Firefox thanks to -moz-border-radius- properties.

.button {
    padding: 4px 10px 3px 25px;
    border: solid 1px #8AB134;
    position: relative;
    cursor: pointer;
    display: inline-block;
    background-image: url( 'bkg.png' );
    background-repeat: repeat-x;
    font-size: 11px;
    height: 16px;
    text-decoration: none;
    color: #40740D;
    -moz-border-radius-bottomleft: 5px;
    -moz-border-radius-bottomright: 5px;
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-topright: 5px;
}
.button img {
    position: absolute;
    top: -4px;
    left: -12px;
    border: none;
}
.button:hover {
    color: #8AB134;

Now the animation. We have three jumps on original Skype button - one large and two small jump. In first jump, icon will go up for 6px, in second 3px and in the last jump 2px. After each jump, the icon will go back to its original position defined in CSS. I guess it is pretty much similar to the Skype button.

$(document).ready(function(){
    $(".button").hover(function(){
        $(".button img")
            // first jump 
            .animate({top:"-10px"}, 200).animate({top:"-4px"}, 200)
            // second jump
            .animate({top:"-7px"}, 100).animate({top:"-4px"}, 100)
            // the last jump
            .animate({top:"-6px"}, 100).animate({top:"-4px"}, 100);
    });
});

Code is tested in Firefox, Safari and IE7. If this doesn't work in IE6, I simply don't care.

The icon used in this tutorial is from Developpers Icons set. Now try the demo, download the source code and enjoy styling your new buttons!  

If you liked this article why don't you share it:

How to create Skype-like buttons using jQuery (via @jankowarpspeed) Share this on StumbleUpon Share this on delicious Share this on Digg Share this on Dzone Share this on DesignBump Send this to friend

Comments

Pingbacks and trackbacks

  1. Trackback from progg.ru How to create Skype-like buttons using jQuery
  2. Trackback from Web Development Community How to create Skype-like buttons using jQuery
  3. Trackback from DotNetShoutout How to create Skype-like buttons using jQuery - Janko Jovanovic
  4. Trackback from Design Bump Story on DesignBump.com
  5. Pingback from designm.ag How to create Skype-like buttons using jQuery
  6. Trackback from How to create Skype-like buttons using jQuery - DotNetBurner How to create Skype-like buttons using jQuery
  7. Pingback from 71squared.co.uk 71² - The ramblings of two 30something developers » How to create Skype-like buttons using jQuery
  8. Pingback from supersite.me SuperSite.Me! » How to create Skype-like buttons using jQuery
  9. Pingback from thisinspires.me links for 2009-03-12 | This Inspires Me
  10. Pingback from blueprintds.com Top Website Designers & Developer Tools | Web Design
  11. Pingback from wcs.wayne.edu Wayne State Web Communications Blog » Blog Archive » [Friday Links] The Pi Day Edition
  12. Pingback from davidwalsh.name Skype-Style Buttons Using MooTools
  13. Pingback from neurosoftware.ro Skype-Style Buttons Using MooTools | Programming Blog
  14. Pingback from reader.misrit.org Skype-Style Buttons Using MooTools | Feed Reader (Beta)
  15. Pingback from mantistechs.com Enlaces rápidos (07-04-2009) | dominios, diseño web, ecommerce - Mantis Technology Solutions Blog
  16. Pingback from webmercial.dk links for 2009-04-13 : Webmercial.dk
  17. Pingback from fishintheriver.com Creat Skype-like buttons using jQuery | Magazine | Resources | Fish in the River
  18. Pingback from businessmarketingexperts.com How to Create Skype-like Buttons with jQuery | Business Marketing Experts
  19. Pingback from beatfly.net JSquared, jQuery e MooTools Javascript library | Beat Fly Blog
  20. Pingback from blarnee.com How to create animated Skype-style buttons using jQuery | blarnee.com
  21. Pingback from chriscoder.com How to create animated Skype-style buttons using jQuery | chriscoder.com
  22. Pingback from answerspluto.com list of urls 4 « Answers Pluto
  23. Pingback from tripwiremagazine.com 60+ Must Have jQuery Toolbox | tripwire magazine
  24. Pingback from muliati.com 60+ Must Have jQuery Toolbox | The Muliati.Com goBlog
  25. Pingback from millionaire.websitesuperhero.com How to create Skype-like buttons using jQuery
  26. Pingback from debras.fr How to create Skype-like buttons using jQuery
  27. Pingback from tripwiremagazine.com 95+ Exceptionally Useful jQuery Plugins, Tutorials and Cheat Sheets | tripwire magazine
  28. Pingback from smkn.xsrv.jp ITキヲスク | 2009年3/23~3/29の週間ブックマーク
  29. Pingback from pc-aras.com How to create Skype-like buttons using jQuery | pc-aras
  30. Pingback from pelfusion.com 25 Excellent Collection Of jQuery Tutorials | Tutorials | PelFusion.com
  31. Pingback from huibit05.com 25 Excellent Collection Of jQuery Tutorials | huibit05.com
  32. Trackback from You are now listed on FAQPAL How to create Skype-like buttons using jQuery
  33. Pingback from ajax.wespai.com How to create Skype-like buttons using jQuery | AJAX Collection & Research
  34. Trackback from Vote on this article at blogengage.com How to create Skype-like buttons using jQuery
  35. Pingback from resourcesmix.info Web Form Enhancement with jQuery Plugins and Tools | ResourcesMix.info | Huge collection of design and development tips, tutorials, downloads and news. actionscript, ajax, banking, brushes, business, css, design, download, downloads, Featured, flash, fonts, Freelance, Graphic, html, icon, illustrator, inspiration, javascript, photos, photoshop, resources, texture, textures, theme, tips, tools, tutorials, vector, Wallpapers, Web design, wordpress
  36. Pingback from vietphotoshop.wordpress.com 95+ Exceptionally Useful jQuery Plugins, Tutorials and Cheat Sheets « Photoshop.vn – Your Design Resource
  37. Pingback from jquery.wisdomplug.com How to create Skype-like buttons using jQuery | jQuery Wisdom
  38. Pingback from ajaxupdates.com Skype-like buttons using jQuery
  39. Pingback from jquerylabs.com Skype-like buttons
  40. Pingback from ajaxcss.com All about Buttons, Buttons … & Buttons (CSS, Glowing, Javascript, Advance) | Ajax CSS and WEB2.0 Resource Directory. Ajax Effects, Components Drag Drop, CSS Gallery, AJAX CSS PHP Tutorial AjaxCSS.com
  41. Pingback from designersandbox.com 30 jQuery Form Element Enhancing Tools Collection | Designer Sandbox
  42. Pingback from bijusubhash.com Create Skype-like Buttons with jQuery | bijusubhash.com
  43. Pingback from neurosoftware.ro 75+ Top jQuery Plugins to improve Your HTML Forms | Programming Blog
  44. Pingback from afiffattouh.com 75+ Top jQuery Plugins to improve Your HTML Forms | Afif Fattouh - Web Specialist
  45. Pingback from bianchient.com 30+ jQuery Plugins to Improve Usability and Look and Feel of HTML Forms - Memphis, Tennessee's Premier Web Design Agency

Add comment

   
        Country flag
biuquote
Loading