Javascript 使用jquery的过滤器按钮是什么
我有一个jQuery:Javascript 使用jquery的过滤器按钮是什么,javascript,jquery,Javascript,Jquery,我有一个jQuery: $(".utente1").click(function () { $('.newdiv').hide(); $('.hidecolor').find('.vc_single_image-img').css('filter','grayscale(100%)'); $(".utente-1").show(600); $('.utente1').find('.img').css('filter','
$(".utente1").click(function () {
$('.newdiv').hide();
$('.hidecolor').find('.vc_single_image-img').css('filter','grayscale(100%)');
$(".utente-1").show(600);
$('.utente1').find('.img').css('filter','none')
})
当我单击其他按钮时,按钮Utene1 remaning filter:无
当我单击.Utene1时,它会打开div,但我希望按钮.Utene1也能更改颜色。在Utene1中添加此代码单击:
$(this).css('color','red');
因此,您的完整代码将是:
$(".utente1").click(function () {
$('.newdiv').hide();
$(".utente-1").show(600);
$(this).css('color','red');
});
如果要更改所有按钮的颜色。为这些按钮添加一个comman类,然后设置css:
$(".utente1").click(function () {
$('.newdiv').hide();
$(".utente-1").show(600);
$(".commanClass").css('color','red');
});
请输入完整的HTML代码OK抱歉,我已经插入了颜色过滤器。。例如过滤器:灰度100%;我解析了$'.utete-1-'.find'.img'.css'filter','none'