I need to add fade function in the following script. I need that the css element which gets style display: none fadeOut and the css element which gets style display: block fadeIn. How shall I do that?
$(document).ready(function() {
$("#contacts").toggle(function() {
$("#phone_2").css("display", "block");
$("#phone_1").css("display", "none");
}, function() {
$("#phone_1").css("display", "block");
$("#phone_2").css("display", "none");
});
});
By the way, you can do that a lot simpler with:
Live DEMO