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

5 years ago
$(document).ready(function(){
5 years ago
// ------------ DRAG ------------
5 years ago
$( function() {
5 years ago
$( ".draggable" ).draggable(
//{ containment: [-1300,-750,1800,1250] }
);
5 years ago
});
5 years ago
5 years ago
// ------------ ZOOM -------------
5 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;
5 years ago
5 years ago
});