Skip to content

Instantly share code, notes, and snippets.

@dbalatero
Forked from anonymous/contacttab.js
Created April 8, 2010 21:48
Show Gist options
  • Save dbalatero/360598 to your computer and use it in GitHub Desktop.
Save dbalatero/360598 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function () {
// init
var $contact = $('#contact');
$contact.css({right: ( -($contact.width() ) + 19 ) });
$contact.mouseleave(function () {
if ($contact.hasClass('active')) {
$contact.removeClass('active');
$contact.animate({right: ( -($contact.width() ) + 20 ) });
}
});
$contact.mouseenter(function () {
if (!$contact.hasClass('active')) {
$contact.addClass('active');
$contact.animate({right: 0 });
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment