animation: scaleUp 0.3s linear 0.4s forwards;
animation: scaleDown 0.3s linear forwards;
こんにちは、コンテンツをフィルタリングするときにコンテンツをアニメーション化しようとしています。「クラスを共有しないすべての要素を非表示にする」場合と「クラスを共有するすべての要素を表示する」場合に、上記の2つのcssルールを以下のjavascriptコードに追加しようとしていますが、開く方法と私は Javascript についてよく知らないので、タグを閉じてください。あなたが私を助けることができれば、私は本当に感謝しています. ありがとう。
$(document).ready(function() {
$('#filterOptions li a').click(function() {
// fetch the class of the clicked item
var ourClass = $(this).attr('class');
// reset the active class on all the buttons
$('#filterOptions li').removeClass('active');
// update the active state on our clicked button
$(this).parent().addClass('active');
if(ourClass == 'all') {
// show all our items
$('#ourHolder').children('div.item').show();
}
else {
// hide all elements that don't share ourClass
$('#ourHolder').children('div:not(.' + ourClass + ')').hide();
// show all elements that do share ourClass
$('#ourHolder').children('div.' + ourClass).show();
}
return false;
});
});