0
Not visualizing JS
Hi, I made this code on Notepad++ (and it works) and I wanted to publish it here to share it easily but when I copy-pasted it here, it didn't work. I tried to switch 'let' with 'var' but anything changes. Anyone have ideas? https://code.sololearn.com/WXniqRd0QbTA/?ref=app Thanks Alessio
4 ответов
+ 9
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1 align="center">Counters</h1>
<script>
"use strict";
//Canvas Declaration
var canvas = document.createElement('canvas');
document.body.appendChild(canvas);
var ctx = canvas.getContext("2d");
//...your code...
canvas.addEventListener('click', mouseClick);
</script>
</body>
</html>
<!--
It works but need improvements in mouse positioning.
-->
0
Doesnt work code in SL in mobile, SL in PC or both?
0
@Наталья Ошуркова I knew that the mouseClick pos was relative to the window and not to canvas but I didn't know how to solve it so thanks a lot!
0
@Daniel Fernández Hidalgo Both