box
The box
plugin will the measure position and dimension of a spirit.
gui.Spirit.extend({
onready: function() {
this.super.onready();
console.log(this.box.localX + this.box.height);
}
});
These properties are readonly. If you are looking to change position and dimension, please refer to the css
plugin. Also note that these things are implemented as properties, not methods, using getters.
width
- Width of the spirit element
height
- Height of the spirit element
localX
- Horizontal position relative to positioned ancestor
localY
- Vertical position relative to positioned ancestor
pageX
- Horizontal position relative to the full page (includes scrolling)
pageY
- Vertical position relative to the full page (includes scrolling)
clientX
- Horizontal position relative to the viewport (ex scrolling)
clientY
- Vertical position relative to the viewport (ex scrolling)
Note on layout trashing