Skip to content

Commit 55af036

Browse files
authored
Merge pull request #5084 from Aloneduckling/correct-style-example
Changed dom-style example code
2 parents 6d9b03d + 1983eed commit 55af036

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/dom/dom.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,23 +1854,26 @@ p5.Element.prototype._rotate = function() {
18541854
* let myDiv = createDiv('I like pandas.');
18551855
* myDiv.style('font-size', '18px');
18561856
* myDiv.style('color', '#ff0000');
1857+
* myDiv.position(0, 0);
18571858
* </code></div>
18581859
* <div><code class='norender'>
18591860
* let col = color(25, 23, 200, 50);
18601861
* let button = createButton('button');
18611862
* button.style('background-color', col);
1862-
* button.position(10, 10);
1863+
* button.position(0, 0);
18631864
* </code></div>
18641865
* <div><code class='norender'>
1865-
* let myDiv;
1866+
* let myDiv, fontSize;
18661867
* function setup() {
18671868
* background(200);
18681869
* myDiv = createDiv('I like gray.');
1869-
* myDiv.position(20, 20);
1870+
* myDiv.position(0, 0);
1871+
* myDiv.style('z-index', 10);
18701872
* }
18711873
*
18721874
* function draw() {
1873-
* myDiv.style('font-size', mouseX + 'px');
1875+
* fontSize = min(mouseX, 90);
1876+
* myDiv.style('font-size', fontSize + 'px');
18741877
* }
18751878
* </code></div>
18761879
*/

0 commit comments

Comments
 (0)