2016-05-12 11 views
0

別のメニューを開くか、矢印をもう一度クリックすると、矢印をクリックして回転させることができますか?メニューが切り替わると矢印が回転する

JSFIDDLE

JS:

//Dropdown Menu 
$("a.slide-dropdown").click(function slideMenu() 
{ 
$(this).next('ul').slideToggle(); 
$(this).parent().siblings().children().next('ul').slideUp(); 

}); 

//Arrows 
$(".crossRotate").click(function() { 
//alert($(this).css("transform")); 
if ($(this).css("transform") == 'none') 
{ 
    $(this).css("transform" , "rotate(-180deg)"); 
} 
else 
{ 
    $(this).css("transform","") ; 
} 
}); 

答えて

1

あなたのcrossRotate clickイベントを更新する必要があります。

この

//Arrows 
$(".crossRotate").click(function() { 
    //alert($(this).css("transform")); 
    $(".crossRotate").css("transform","none") ; 
    if ($(this).css("transform") == 'none') 
    { 
     $(this).css("transform" , "rotate(-180deg)"); 
    } 
    else 
    { 
     $(this).css("transform","none") ; 
    } 
}); 
をお試しください
関連する問題