Is possible to set a toggle for each DIV ? I have two DIV with same
class .show_hide

I click on first div and toggle call the first function (alert '1'), I
click on second DIV and toggle call the second function (alert '2').
This is not good!

== I need something like this: ==

- Click on first DIV call first function.
- Click on second DIV call first function.

- Click on first DIV twice, call function 1 and function 2.
- Click on second DIV twice, call function 1 and function 2.

Any idea how to solve this? Thanks!

On Jun 10, 2:06 am, yo2lux <[EMAIL PROTECTED]> wrote:
> This is my jQuery code:
>
> $(document).ready(function()
> {
>     $('.show_hide').click(function()
>     {
>              $(this).toggle(function()
>              {
>                  alert('1');
>              },function() {
>                  alert('2');
>              });
>     });
>
> });
>
> This code set an event listener on two DIV with class .show_hide. Now,
> I click on first div and nothing happen. I click again and alert box 1
> pop-up. This is strange , why statement run only at second click ?
>
> Thanks!

Reply via email to