Js ruft Element-Rect-Informationen ab

Js ruft Element-Rect-Informationen ab

Element ist ein beliebiges HTML-Element:

var rect =element.getBoundingClientRect();

Die Druckinformationsstruktur ist wie folgt:

{„x“:169, „y“:256.796875, „width“:208, „height“:106, „top“:256.796875, „right“:377, „bottom“:362.796875, „left“:169}

おすすめ

転載: blog.csdn.net/qq_26318597/article/details/132736339