What does img[@rel= mean in this jQuery plugin?
var _thumb = $('.galleria img[@rel="'+_src+'"]');
Full source here
Is it a deprec开发者_如何学运维ated selector?
It's an attribute selector that will find all <img>
elements with a rel
attribute equal to the value to the right of the =
sign.
And yes, the @
portion was deprecated as of jQuery 1.2 and removed completely in 1.3. Now you'd just use "img[rel=...]"
.
From jQuery selectors:
Note: In jQuery 1.3 [@attr] style selectors were removed (they were previously deprecated in jQuery 1.2). Simply remove the '@' symbol from your selectors in order to make them work again.
@
used to be required in attribute selectors, but no longer in jQuery 1.2 + and removed in jQuery 1.3
It was deprecated in version 1.2 and removed in version 1.3.
From the jQuery selector documentation
Note: In jQuery 1.3 [@attr] style selectors were removed (they were previously deprecated in jQuery 1.2). Simply remove the '@' symbol from your selectors in order to make them work again.
精彩评论