On 15/11/06, Rick Faircloth <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi, all…
>
> Trying to grasp js and jQuery…why won't this code work?
>
> (No response on my test page at all to the code…)
>
> JQuery code:
>
> $(document).ready(function() {
>
>
> $("div.ann").find("p.title").hide().end().find("p.text").click(function() {
>
>          var answer = $(this).next();
>
>          if (answer.is(':visible')) {
>
>              answer.slideUp();
>
>          } else {
>
>              answer.slideDown();
>
>          }
>
>      });
>
> });
>
> HTML:
>
> <div class="ann">
>
> <p class="title">
>
> This is my title…
>
> </p>
>
> <p class="text">
>
> This is my text…
>
> </p>
>
> </div>
>
> ???
>
> Thanks,
>
> Rick

I think you have p.title and p.text mixed up. You are hiding p.title
and applying the click event to p.text (which looks for the next
element, which doesn't exist).

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to