css disable zoom on mobile
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
css disable zoom on mobile
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
zoom image inside div and move
$("#videoContainer").css('height', $('#stream').height());
$("#videoContainer").css('width', $('#stream').width());
$('#videoContainer').on('mousewheel', function (event) {
var height = $('#stream').height();
var width = $('#stream').width();
if (height == 480 && width == 640 && event.deltaY > 0) {
} else {
if (event.deltaY > 0) {
height /= 2;
width /= 2;
$("#stream").css('height', height);
$("#stream").css('width', width);
}
else if (event.deltaY < 0) {
height *= 2;
width *= 2;
$("#stream").css('height', height);
$("#stream").css('width', width);
}
}
});
function startDrag(e) {
if (!e) {
var e = window.event;
}
var targ = e.target ? e.target : e.srcElement;
if (targ.className !== 'dragme') {
return
}
offsetX = e.clientX;
offsetY = e.clientY;
if (!targ.style.left) {
targ.style.left = '0px'
}
if (!targ.style.top) {
targ.style.top = '0px'
}
coordX = parseInt(targ.style.left);
coordY = parseInt(targ.style.top);
drag = true;
document.onmousemove = dragDiv;
return false;
}
function dragDiv(e) {
if (!drag) {
return
}
if (!e) {
var e = window.event
}
var targ = e.target ? e.target : e.srcElement;
// move div element
targ.style.left = coordX + e.clientX - offsetX + 'px';
targ.style.top = coordY + e.clientY - offsetY + 'px';
return false;
}
function stopDrag() {
drag = false;
}
window.onload = function () {
document.onmousedown = startDrag;
document.onmouseup = stopDrag;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us