Skip to content

Commit 58d9025

Browse files
committed
Altered instantiation so that the pjs instance is returned, in order to give access to it's methods and change the state of the particles after instantiation.
1 parent 20d5807 commit 58d9025

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

particles.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,9 @@ window.particlesJS = function(tag_id, params){
15141514

15151515
/* launch particle.js */
15161516
if(canvas != null){
1517-
pJSDom.push(new pJS(tag_id, params));
1517+
var pjs = new pJS(tag_id, params);
1518+
pJSDom.push(pjs);
1519+
return pjs;
15181520
}
15191521

15201522
};

0 commit comments

Comments
 (0)