Tuesday 15 May 2012

find - Access once to the child and then reuse the parent in jQuery (1.9.x and more) -


I'm looking forward to doing this work, I want to fill the caption of the clicked image, and I'm sure That's a better solution.

Thanks for your reply, Allen (FR)

is Jquery:

  $ bmg .find ('title, caption') . FadeIn () Parent () .find ('.title') .text (title). Parent () .find ('.coptions') .text (caption);   

HTML is:

  & lt; Div class = "big image carousel" & gt; & Lt; Img src = "http://placehold.it/450x240/FFFFCC" & gt; & Lt; Div class = "title" & gt; Thi Phato & lt; / Div & gt; & Lt; Div class = "caption" & gt; Ekak eram rirum hike in tinetur & lt; / Div & gt; & Lt; / Div & gt;   

PS: $ bImg = $ ('big image');

You can use and

  $ Bmg .find ('title, caption'). FadeIn () .filter ('.title') gets / /. Out of the archive Title (title) .siblings ('.coptions') .text (caption);    

No comments:

Post a Comment