File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,35 @@ Full API reference:
1414
1515```
1616
17+ ::: tip
18+ If you wanna update the random value after it's been declared, you can use the ` generate() ` function:
19+ ``` js
20+ const example = new mojs.Burst ({
21+ radius: { ' rand(4, 40)' : ' rand(50, 100)' }
22+ });
23+
24+ document .addEventListener ( ' click' , function (e ) {
25+ example .generate ().replay ();
26+ });
27+ ```
28+ :::
29+
30+ <MojsInteractive
31+ id="example"
32+ autoplay
33+ height="200px"
34+ global="example"
35+ code=
36+ "const example = new mojs.Burst({
37+ radius: { 'rand(4, 40)' : 'rand(50, 100)' }
38+ });
39+
40+ document.addEventListener( 'click', function (e) {
41+ example.generate().replay();
42+ });
43+
44+ example.play();"
45+ >
46+ </MojsInteractive>
47+
1748- [ CodePen Example] ( https://codepen.io/sandstedt/pen/dyXevEE?editors=0010 )
You can’t perform that action at this time.
0 commit comments