Okay, so here's the shell of the code that we saw before, where we're
grabbing the click location on the document, which is just the whole website.
And we're going to be running some steps, using this weird function syntax,
that we'll actually be learning a little bit more about soon.
Every time the page is clicked, we create two new variables, x and y.
Both of them use this location object,
this location event object from the click, and we grab its pageX and its pageY,
which are simply the pixel values of the x and y location of the clicks.
Once we have the x and y locations, we simply pass them into logClicks and
we should see, when we click, there it is again, x and y locations.
حسنًا، يعد هذا هو shell للتعليمة البرمجية التي رأيناها من قبل؛ حيث
.نستولي على موقع النقر في المستند، والذي يمثل موقع الويب بالكامل فحسب
،وسوف نقوم بتشغيل بعض الخطوات باستخدام صيغة function الغريبة هذه
.والتي سنتعلم المزيد عنها فعليًا قريبًا
.في كل مرة يتم فيها النقر فوق الصفحة، نقوم بإنشاء متغيرين جديدين، هما x وy
،يستخدم كلا المتغيرين كائن الموقع هذا
،أو كائن حدث الموقع هذا من النقرة، ونستولي على pageX وpageY الخاصين به
.وهما ببساطة قيمتا البكسل لموقع x وy للنقرات
بمجرد أن يكون لدينا موقعا x وy، نمررهما ببساطة إلى logClicks
.ويجب أن نرى، عند النقر، أن هناك موقعي x وy مرة أخرى
좋아요 저번에 본 코드의 뼈대가 있어요
웹 사이트 전체에서 클릭하는 위치를 잡아내는데
이 이상한 함수 문법으로 몇 가지를 실행해볼게요
곧 더 배울 수 있을 거예요
페이지가 클릭 될 때마다 새로운 x와 y 변수를 생성합니다
두 변수 모두 loc 객체를 사용합니다
클릭으로 pageX와 pageY 값을 잡아내는 거예요
단순히 클릭한 위치에 있는 픽셀의 x와 y 좌표 말입니다
x와 y 좌표를 얻으면 그것을 logClicks로 넘기고
클릭을 하면 이렇게 x와 y 좌표가 기록되게 됩니다
Ok, aqui está o shell do código que vimos antes,
onde pegamos a localização do click no documento, que é o site inteiro.
E vamos executar algumas etapas usando esta sintaxe de função esquisita,
sobre a qual vamos aprender mais coisas em breve.
Toda vez que a página for clicada, criamos duas novas variáveis, x e y.
Ambas usam este objeto de localização,
este objeto de evento de localização, a partir do clique e pegamos o pageX e o pageY,
que são simplesmente os valores de pixel das localizações de x e y dos cliques.
Assim que tivermos as localizações de x e y, simplesmente as passamos para logClicks
e, devem aparecer, ao clicarmos, aqui estão novamente, as localizações de x e y.
好的 这是我们之间见过的代码的框架
这里抓取文档中 也就是整个网页中的点击位置
接下来我们要执行一些步骤 使用这个看起来有点奇怪的函数语法
很快我们会学习更多相关的内容
每次页面被点击时 我们创建两个变量 x 和 y
他们都使用位置对象
由点击获取到的位置事件对象 我们获取它的 pageX 和 pageY
也就是点击时 x 和 y 位置的像素值
一旦我们有了 x 和 y 的位置 我们就把它们传入
我们会看到 当我们点击后 x 和 y 的位置又一次出现了