Have you tried .addClass() and .removeClass() and setting up a different
action for each, thus simulating toggle?




craigeves wrote:
> 
> 
> Hi
> 
> Can anyone help? I'm trying to toggle a class on the span .arrow when
> you click .msg_head. I have several classes of .arrow on the page and
> only want to toggle the class of the span within the element i'm
> clicking. This is my code - but it doesn't work... any advice?
> 
> Thanks
> 
> Craig
> 
> 
> $(".msg_head").click(function(){
>               $(this).next(".msg_body").slideToggle("slow");
>               $(this).next(".arrow").toggleClass("arrow_up");
>       });
> 
> 
> 
>  <div class="msg_list">
>             <div class="panel">
>               <div class="msg_head">Design supplied by us</div>
>               <div class="msg_body m10">
>                 <p>orem ipsum dolor sit amet, consectetuer adipiscing
> elit orem ipsum dolor sit amet, consectetuer adipiscing elit </p>
>                 <p class="last"> designsupplied.php Design by
> you </p>
>               </div>
>             </div>
>             <div class="msg_head">Design supplied by you</div>
>             <div class="msg_body">
>               <p>orem ipsum dolor sit amet, consectetuer adipiscing
> elit orem ipsum dolor sit amet, consectetuer adipiscing elit </p>
>               <p class="last"> design.php Design by you </
> p>
>             </div>
>           </div>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Toggle-Classes-tp25783323s27240p25783933.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to