Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery hover animation will not hide text

Tags:

jquery

css

I'm using jQuery for hover over effects. I plan on expanding it from what it is now but I'm having a issue. The issue is I want to hide some text until you hover over that div and then it will show it. Then once you move to a different div it will hide it again?

This is what I have so far. http://jsfiddle.net/UDFw7/

CSS

.divname {
height: 20px;
width: 300px;
border: 1px solid black;
}

javascript

$('.divname').hover(function() {
$(this).animate({
    height: '40px'
}, 300);
},function() {
$(this).animate({
    height: '20px'
}, 300);
});

HTML

<div class='divname'>Text Here</div>
<div class='divname'>Text Here <br /> Hidden text until hover over</div>
<div class='divname'>Text Here</div>
like image 833
chillers Avatar asked Dec 02 '25 12:12

chillers


1 Answers

Add overflow: hidden; to .divname

like image 171
DAC84 Avatar answered Dec 04 '25 05:12

DAC84



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!