I'm having trouble understanding a type of jQuery selection, and I hope someone can explain it to me in clear terms.
It's taken from this Stack Overflow question.
Basically, it has the common jQuery: $( selector ).
But inside that it has $({ y: iFrameScrollY }).
I've never seen this before. What does it mean to have { ... } and someVal: anotherVal inside the brackets?
Also, please recommend a different title for this question, to make it easier for others to find it.
{}syntax, that's a JavaScript object literal (also called an object initialiser). For more info read Working With Objects or some other JS tutorial about objects. If you haven't seen it before then chances are it won't (yet) make sense to you when I say that according to the$()function documentation, when you pass an object to$()it returns that object wrapped in a jQuery object.