We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2f2f55 commit 514e94eCopy full SHA for 514e94e
particles.js
@@ -341,8 +341,18 @@ function launchParticlesJS(tag_id, params){
341
342
/* el on mousemove */
343
detect_el.onmousemove = function(e){
344
- pJS.interactivity.mouse.pos_x = e.offsetX;
345
- pJS.interactivity.mouse.pos_y = e.offsetY;
+
+ if(detect_el == window){
346
+ var pos_x = e.pageX,
347
+ pos_y = e.pageY;
348
+ }
349
+ else{
350
+ var pos_x = e.offsetX,
351
+ pos_y = e.offsetY;
352
353
354
+ pJS.interactivity.mouse.pos_x = pos_x;
355
+ pJS.interactivity.mouse.pos_y = pos_y;
356
357
if(pJS.retina){
358
pJS.interactivity.mouse.pos_x *= 2;
@@ -517,4 +527,4 @@ window.particlesJS = function(tag_id, params){
517
527
launchParticlesJS(tag_id, params);
518
528
}
519
529
520
-};
530
+};
0 commit comments