我想抓住页面上有css background-image的所有元素.我可以通过过滤功能来做到这一点,但在包含许多元素的页面上它非常慢:
$('*').filter(function() { return ( $(this).css('background-image') !== '' ); }).addClass('bg_found');
有没有更快的方法来选择具有背景图像的元素?
css jquery jquery-selectors
css ×1
jquery ×1
jquery-selectors ×1