hi,

for 01. try this:

$(this).find(".thumb").animate({ "height": "50px" }, "fast");

for 02.:

"hover" is just a "helper-function".
it simplifies the process of binding.

see this example from the blog-entry (http://jquery.com/blog/
2008/01/15/jquery-122-2nd-birthday-present/) for the latest jquery-
release:

$("li").hover(function(){
  $(this).addClass("hover");
}, function(){
  $(this).removeClass("hover");
});

$("li").bind("mouseenter", function(){
  $(this).addClass("hover");
}).bind("mouseleave", function(){
  $(this).removeClass("hover");
});

they do both the same.

greetings,

torsten


On 25 Jan., 04:54, Micky Hulse <[EMAIL PROTECTED]> wrote:
> 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

Reply via email to