nested click functies (Jquery)

Status
Niet open voor verdere reacties.

phobia

Terugkerende gebruiker
Lid geworden
4 sep 2006
Berichten
1.777
ik heb 3 div's nested in elkaar
HTML:
<div class="Click">
   <div class="Inbox">
      <div class="wrapper">
      <div class="time">
                content
      </div>
      </div>
   </div>
</div>
Nu krijgen alle 3 de divs een cick functie maar ik krijg de laatste niet werkend.
Code:
    $(".Click").click(function(){
            $(this).find(".Inbox").toggle()  
    })
    
    $(".Inbox").click(function(e){
        e.stopPropagation();
        $(this).find(".wrapper").toggle()
    })

    $(".time").click(function(){
        //e.stopPropagation();
        alert("Add to trash")
    })

Kan iemand mij op weg helpen???
 
Laatst bewerkt:
Je bent de puntkomma's vergeten:

[js] $(".Click").click(function(){
$(this).find(".Inbox").toggle();
});

$(".Inbox").click(function(e){
e.stopPropagation();
$(this).find(".wrapper").toggle();
});

$(".time").click(function(){
//e.stopPropagation();
alert("Add to trash");
});[/js]
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan