omg
omg

Reputation: 139862

What does img[@rel= mean in this jQuery plugin?

var _thumb = $('.galleria img[@rel="'+_src+'"]');

Full source here

Is it a deprecated selector?

Upvotes: 0

Views: 1421

Answers (4)

Guffa
Guffa

Reputation: 700302

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.

Upvotes: 0

Russ Cam
Russ Cam

Reputation: 125488

@ used to be required in attribute selectors, but no longer in jQuery 1.2 + and removed in jQuery 1.3

Upvotes: 0

Crescent Fresh
Crescent Fresh

Reputation: 116980

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=...]".

Upvotes: 2

cletus
cletus

Reputation: 625057

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.

Upvotes: 0

Related Questions