You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
615 B
JavaScript

4 years ago
$(document).ready(function(){
4 years ago
// ------------ DRAG ------------
4 years ago
$( function() {
4 years ago
$( ".draggable" ).draggable(
//{ containment: [-1300,-750,1800,1250] }
);
4 years ago
});
4 years ago
4 years ago
// ------------ ZOOM -------------
4 years ago
function zoom(event) {
event.preventDefault();
scale += event.deltaY * -0.01;
// Restrict scale
scale = Math.min(Math.max(.125, scale), 4);
// Apply scale transform
el.style.transform = `scale(${scale})`;
}
let scale = 1;
const el = document.querySelector('body');
el.onwheel = zoom;
4 years ago
4 years ago
});