Possible duplicate:
Can someone explain this jQuery code?
I posted this before, but I would like to clarify my question (and I cannot do this in the old thread).
The code:
$(document).ready(function()
{
var rot=$('#image3').rotate({maxAngle:25,minAngle:-55,
bind:
[
{"mouseover":function(){rot[0].rotateAnimation(85);}},
{"mouseout":function(){rot[0].rotateAnimation(-35);}}
]
});
});
This is taken here: http://wilq32.googlepages.com/wilq32.rollimage222 , and there is a demo function (animation of image rotation - 3rd demo on the page).
What I need to explain:
I understand that the variable “rot” is declared there, but I can’t understand where the declaration ends ....
When a variable is used, it is used as rot [0], which means [0]? is it an array?
I have never seen the attachment used so, the original syntax
$ ("selector"). bind (type, [data], fn);
What's happening? What are all commas and [] about?
- , script "X", "Y" . ( "" )?
!