当点击“x”关闭图标时,有箭头切换回(0deg)
问题描述:
我一直在研究手风琴,并将其与我需要的接近。但是,在点击关闭“x”图标后,我似乎无法将箭头旋转回0度。切换关闭,但箭头停留在向下的位置。当点击“x”关闭图标时,有箭头切换回(0deg)
$('#main').each(function() {
var $accordian = $(this);
$accordian.find('.view-m').on('click', function() {
$accordian.find('.mobile-content-body').slideUp();
$accordian.find('span').css('transform', 'rotate(0deg)');
if (!$(this).next().is(':visible')) {
$(this).next().slideDown();
$(this).find('span').css('transform', 'rotate(90deg)');
$(this).next().slideDown();
$accordian.find('.close').click(function() {
$(this).parent().slideUp(500);
$(this).find('span').css('transform', 'rotate(0deg)');
});
}
});
});
答
的问题是在这条线:
$(this).find('span').css('transform', 'rotate(0deg)');
您正在搜索的箭头内的X按钮。你需要去2元了,和搜索有:这一行
$(this).find('span').css('transform', 'rotate(0deg)');
$('#main').each(function() {
var $accordian = $(this);
$accordian.find('.view-m').on('click', function() {
$accordian.find('.mobile-content-body').slideUp();
$accordian.find('span').css('transform', 'rotate(0deg)');
if (!$(this).next().is(':visible')) {
$(this).next().slideDown();
$(this).find('span').css('transform', 'rotate(90deg)');
$(this).next().slideDown();
$accordian.find('.close').click(function() {
$(this).parent().slideUp(500);
$(this).parent().parent().find('span').css('transform', 'rotate(0deg)');
});
}
});
});