File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 6
6
/* v1.1.1
7
7
/* ----------------------------------------------- */
8
8
9
- function launchParticlesJS ( tag_id , params ) {
9
+ var pJS = function ( tag_id , params ) {
10
10
11
11
var canvas_el = document . querySelector ( '#' + tag_id + ' > canvas' ) ;
12
12
13
13
/* particles.js variables with default values */
14
- window . pJS = {
14
+ this . pJS = {
15
15
canvas : {
16
16
el : canvas_el ,
17
17
w : canvas_el . offsetWidth ,
@@ -99,6 +99,8 @@ function launchParticlesJS(tag_id, params){
99
99
}
100
100
} ;
101
101
102
+ var pJS = this . pJS ;
103
+
102
104
Object . deepExtend = function ( destination , source ) {
103
105
for ( var property in source ) {
104
106
if ( source [ property ] && source [ property ] . constructor &&
@@ -750,6 +752,8 @@ function hexToRgb(hex){
750
752
751
753
/* --- LAUNCH --- */
752
754
755
+ window . pJSDom = [ ] ;
756
+
753
757
window . particlesJS = function ( tag_id , params ) {
754
758
755
759
/* no string id? so it's object params, and set the id with default id */
@@ -775,7 +779,7 @@ window.particlesJS = function(tag_id, params){
775
779
776
780
/* launch particle.js */
777
781
if ( canvas != null ) {
778
- launchParticlesJS ( tag_id , params ) ;
782
+ pJSDom . push ( new pJS ( tag_id , params ) ) ;
779
783
}
780
784
781
785
} ;
You can’t perform that action at this time.
0 commit comments