Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我得到了这样的代码:
$('.mainp').find('A[href$=jpg]','A[href$=jpeg]','A[href$=gif]','A[href$=png]').fancybox();
它仅适用于 .jpg 文件。当我将其更改为:
$('.mainp').find('A[href$=png]').fancybox();
它适用于 .png 文件。那么我做错了什么,fancybox() 不适用于所有类型的文件?
逗号属于字符串,我认为find不能带很多参数。
find
$('.mainp').find('A[href$=jpg], A[href$=png]').fancybox();
另请参阅:选择器/多个