Hi guys. I'm kinda new to jquery and I have created an hide/show animation for a page, what this animation does is when you hover on the link "Call us" it shows a phone (1800blabla) but now I've been asked that the phone number should have a delay before it hides back again. I will appreciate any help. Please find the code below.
HTML
<ul class="top-links">
<li>
<div id="call-us">
<a class="showPhoneNumberLink" href="#">Call Us</a>
<span class="showPhoneNumberNumber">1.888.227.6482</span>
</div>
</li>
</ul>
jQuery
$('#call-us a.showPhoneNumberLink').mouseenter(
function() {
var _this = $(this);
_this.hide();
_this.parent().width(0);
_this.parent().find('span').show();
_this.parent().animate({ 'width': '78px' }, 500);
return false;
});
$('ul.top-links').mouseleave(
function() {
var _this = $('#call-us a.showPhoneNumberLink');
_this.show();
_this.parent().find('span').hide();
_this.parent().animate({ 'width': '45px' }, 800);
return false;
});
CSS
#call-us span.showPhoneNumberNumber {display:none}