Hi there, I have encountered a problem and could really use your assistance.
I am attempting to create a menu that displays content when you hover over an li tag. The first content should always be visible when hovering over the first li option or if no li is hovered at all.
I have made an attempt at this, and you can view a demo here: https://jsfiddle.net/sqftzuja/
However, as you can see, it's not working quite right and sometimes shows more than one piece of content.
Here is my current script:
$(document).ready(function() {
$("#nav3 li:first-child").addClass("tab-active");
$('#nav3 li').click(function() {
var section4 = $(this).attr('data-id');
$("#nav3 li").removeClass("tab-active");
$(this).addClass("tab-active");
$('.tv-corporativa').hide();
$(section4).fadeIn(800);
});
});
If anyone has suggestions on how to improve it, I would greatly appreciate the help!
Thank you in advance!