Here is a little JavaScript code snippet that I have:
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
I want to create a fadeout effect when the targeted ID is set to style.display = 'none';
. I know that I need to use .fadeOut('slow')
, but I'm struggling with figuring out exactly how and where to incorporate that part into my code.