updated v2 test version

This commit is contained in:
Samuel Philipp 2018-10-03 22:27:22 +02:00
parent 55f2cfbabe
commit 3f61615bd3

View file

@ -43,13 +43,24 @@
<script type="application/javascript">
$(document).ready(function () {
document.addEventListener('touchmove', function (event) {
event.preventDefault();
var e = event.touches[0];
move(e);
});
document.addEventListener('mousemove', function (event) {
event.preventDefault();
move(event);
});
});
function move(event) {
var mouseX, mouseY;
var ww = $(window).width();
var wh = $(window).height();
var traX, traY, traX2, traY2;
$(document).mousemove(function (e) {
mouseX = e.pageX;
mouseY = e.pageY;
mouseX = event.pageX;
mouseY = event.pageY;
traX = (((50 * mouseX) / ww)) - 50;
traY = (((50 * mouseY) / wh)) - 50;
traX2 = (50 + traX) * -1;
@ -63,8 +74,7 @@
"left": traX2 + "px",
"top": traY2 + "px"
});
});
});
}
</script>
</head>
<body>