I have implemented a JavaScript script that toggles the visibility of elements on a webpage, but I am facing an issue where it only displays the div with a specific id and does not show any other nested divs within that particular div.
Below is my CSS code:
.content {
position: relative;
}
.content div {
display: none;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
And here is my JavaScript code:
$(".link").click(function(e) {
e.preventDefault();
$('.content div').fadeOut('slow');
$('#' + $(this).data('rel')).fadeIn('slow');
});