[jQuery] $(this) and bind()? Noobish questions...
Hi,
Two quick questions:
-----
01.
$(".item").hover(
function() {
console.log(this); /* For Firebug. */
$(this + ' .thumb').animate({ "height": "50px" }, "fast"); /* How to
target a child element of $(this)? */
},
function() {
console.log(this); /* For Firebug. */
$(this + ' .thumb').animate({ "height": "25px" }, "fast"); /* How to
target a child element of $(this)? */
}
);
So, $(this + ' .thumb') does not work (to be expected)... But how can
I make sure I target the child element $(".thumb") of $(this)?
Here is the HTML:
<div class="item">
<div class="thumb"></div>
</div>
-----
02.
I am trying to learn when I should use bind() in my jQuery coding...
Would I want to bind() the "hover" via the above code snippet?
-----
Tips would be spectacular! :D
Thanks a million in advance.
Cheers,
Micky