jquery - Call a Javascript function within an inline statement -
Quick question: It's hard to describe, so let me show an example.
To do this anyway: (I am using jQuery but this is a common JavaScript question)
$ ('div.element'). Offset () X;
$ ('Div.element'). Offset () will automatically return {'x': 30, 'y': 180}, so I'm thinking that there is a compact way to do this without making any extra variables. / P>
Thanks! As you said, you can use it exactly:
$ ('Div.element') offset (). Left
OR
$ ('div.element'). Offset ().
Please note that jQuery returns {left: 30, top: 180}
not as you said an X / Y pair.
Comments
Post a Comment