Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MouseEvent coordinates do not take scrolling into account. #5

Open
gugar20 opened this issue Apr 28, 2019 · 1 comment
Open

MouseEvent coordinates do not take scrolling into account. #5

gugar20 opened this issue Apr 28, 2019 · 1 comment

Comments

@gugar20
Copy link

gugar20 commented Apr 28, 2019

I have little to no knowledge of JavaScript, but I found it frustrating that the window scroll position would not be taken into account in the coordinates calculation.

I fixed it by going into the bundle.js file and editing the addEventListener function with the "mousemove" argument so as to add variables corresponding to
window.pageXOffset
window.pageYOffset

Adding (not substracting) these values to the coordinate calculation did the trick for me.

@jimmybow
Copy link
Owner

Hi, you can try visdcc.Run_js to run your javascript more flexibly
https://github.com/jimmybow/visdcc#3-visdccrun_js-

here is the example for adding event listener https://github.com/jimmybow/visdcc/blob/master/example/Run_js/Add_event_and_callback.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants