I have a div, which contains a text inside, when I mouse over it, another div, which is a small bar of height:3px
, stops being display:none
and stays display:block
, until Oh calm, everything is working.
However, I would like the width of this bar to be the same as the size of the div that I hovered over.
For example:
<div>PALAVRA</div>
<div class="barra" style="display:none"></div>
My Jquery is correct:
$( ".internaMenu:eq(0)" ).hover(function() {
$( this ).find('.internaMenuBarra').css({'display':'block','width':'85px'});
},
function() {
$( this ).find('.internaMenuBarra').css('display','none');
});
I set the size in Jquery just to take a test.