usefuls

cssText

The cssText property sets or returns the contents of a style declaration as a string.
object.style.cssText=string
document.getElementById("myP").style.cssText = "background-color:pink;font-size:55px;border:2px dashed green;color:white;"

window.getComputedStyle(elem, null)

var elem = document.getElementById("test");
var theCSSprop = window.getComputedStyle(elem, null).getPropertyValue("background-color");

object.getBoundingClientRect();

rect = element.getBoundingClientRect().top;

The Element.getBoundingClientRect() method returns the size of an element and its position relative to the viewport.

object.getClientRects();

var rectCollection = object.getClientRects();

The Element.getClientRects() method returns a collection of rectangles that indicate the bounding rectangles for each box in a client.

 

Add comment