Skip to content

div get dimensions #391

Closed
Closed
@shiffman

Description

@shiffman

A small thing, but also re: p5.dom a lot of my examples require dynamically accessing the size of a DIV (which changes according to the amount of text). I may be mistaken but I believe p5 only allows for setting the dimensions with size() but for retrieving the width/height I am doing the following:

var w = div.elt.offsetWidth;
var h = div.elt.offsetHeight;

Would it make sense to have a width()/height() method that returns the dimensions?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions