为什么mousemove返回undefined?

时间:2019-06-22 10:23:59

标签: javascript html

我使用mousemove,上下移动时我的e.layerY是不确定的。 滚动nie zostal 232 滚动未定义

这是html,javascript。

# !/usr/bin/env python
# -*- coding: utf-8 -*-
import re

# It's better to use context manager to read files.
# You don't have to explicitly close those files after reading.
with open('./source.txt', 'r') as source:
    text = ''
    for line in source:
        text += line.lower()  # Lower case on reading, why not.

# only latin letters & single spaces at the same time
text = re.sub("[^a-z.]+", " ", text)

# # replace dots with newlines
text = re.sub(r'\.', r'\n', text)

with open('./result.txt', 'w+') as output:
    output.write(text)

我希望得到相同的结果,但是我有let canvas = document.querySelector("canvas"); let topCanvas = canvas.offsetTop; let leftCanvas = canvas.offsetLeft; var mouseDown = false; $(document).dblclick(function(e) { mouseDown = true; $(document).mousemove(poruszmysza); }); function poruszmysza(e) { if (mouseDown == true) { console.log("not considering scroll position"); console.log("scroll nie zostal", e.clientY - topCanvas); console.log("considering scroll position"); console.log("scroll", e.layerY); } }

0 个答案:

没有答案