I am receiving this Uncaught TypeError on a new website I am creating, but I can't work out what is causing the error.
I have recreated the issue at the link below, if you take a look at your browsers JS console you'll see the error occurring, but nothing else happens.
http://jsfiddle.net/EbR6D/2/
Code:
$('.newsitem').hover(
$(this).children('.text').animate({ height: '34px' }),
$(this).children('.text').animate({ height: '0px' }));
Be sure to wrap those in asynchronous callbacks:
$('.newsitem').hover(
function() {
$(this).children('.title').animate({height:'34px'});
}, function() {
$(this).children('.title').animate({height:'0px'});
}
);
You need:
.hover(function(){ ... });
as per the documentation.
You're missing the function
...
$('.newsitem').hover(
$(this).children('.text').animate({height:'34px'}),
$(this).children('.text').animate({height:'0px'})
);
To:
$('.newsitem').hover(function() {
$(this).children('.text').animate({
height: '34px'
});
}, function() {
$(this).children('.text').animate({
height: '0px'
});
});
And the $(this).children('.text')
, is not selecting anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With