lookAt(target_id, target_dz, quickness, face_angle, event_precision) lookAt.messages =  lookAt.events = [start, end]
Rotates the element in the 2D plane (around its Z axis) in such a way that it always faces with the same side another target element.
Which side is the 'face' of the element (that is always oriented towards the target) can be set via the
quickness controls how quickly the element rotates.
target_dz is different than
the "look at" effect becomes 3D, where the element is rotated in 3D space around its X and Y axes.
Visit page Controller # Common Parameters for documentation on the parameters, common to all controllers:
- DOM node ID of the element that serves as a target to look at. You can change this parameter at any time, making the element turn towards and start looking at another target. Default value: ""
- Supplies a fixed Z-axis displacement of the target, relative to this element, enabling "looking" at the target in 3D space. When of value 0 (the default), the target is "looked-at" in 2D space, where this element is rotated around its Z axis (2D rotation). When target_dz is different than 0, the element is rotated in 3D space around its X and Y axes. Default value: 0
How quickly to follow the required orientation.
Values should be in the range (
1), where a value of
0means indefinitely slowly, and a value of
1- instantly. Default value: 0.2
Angle [0 - 360) defining which side of the element is its face (that should face the target).
Default face (
0) is the left-hand side of the element. Default value: 0
Precision, measured in rotation degrees, to use when measuring if the element has started or ended rotating.
A value of
1means that a
startevent will be fired when the controller has to rotate the element more than
1degree, and the
endevent will be fired when the element has reached the target orientation within
1degree. Default value: 1
Visit page Controller # Common Messages for documentation on the messages, accepted by all controllers:
Messages specific to
Visit page Controller # Common Events for documentation on the events, generated by all controllers:
Events fired by
Fired upon the start of rotation of the element when the element has to rotate more than
event_precisiondegrees. If the element has to rotate less than
event_precisiondegrees, the event will not be fired. Event params: none
Fired upon reaching the required orientation within
event_precisiondegrees. Event params: none
Interaction with DOM
- Transforms: Applies one
- CSS: Works with any styling. Does not set any style properties.
- Events: Does not set event listeners.
- Controller introduced in v.0.80