Selectors with $(this)
Selectors with $(this)
Hi, I try to use a hover on a page with thumbnails
When I roll over a thumbnail, I want to change the color of the caption..
-
$('.drop-shadow').hover(function() {
// this is what i want but only for the hovered image
// $('.drop-shadow p').css({ color: "red" });
// try..
// $(this > "p").css({ color: "red" });
// $(this p).css({ color: "red" });
// $(this "p:last-child").css({ color: "red" });
// do i need to wrap 'this' in a jQuery object?
// var $this = $(this);
// how??
}, function() {
// back to normal text color
});
<div class='drop-shadow'>
<a href='index.php?showimage=222'><img src='dscn6869.jpg' class='thumbnails' /></a>
<p>posted: 2 weeks ago<p>
</div>
<div class='drop-shadow'>
<a href='index.php?showimage=221'><img src='DSCN3944.jpg' class='thumbnails' /></a>
<p>posted: 2 weeks ago<p>
</div>