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.
27 lines
538 B
JavaScript
27 lines
538 B
JavaScript
$(document).ready(function(){
|
|
|
|
|
|
// ------------ DRAG ------------
|
|
|
|
$( function() {
|
|
$( ".draggable" ).draggable(
|
|
//{ containment: [-1300,-750,1800,1250] }
|
|
);
|
|
});
|
|
|
|
|
|
// ------------ ZOOM -------------
|
|
|
|
function zoom(event) {
|
|
event.preventDefault();
|
|
scale += event.deltaY * -0.01;
|
|
scale = Math.min(Math.max(.125, scale), 4);
|
|
el.style.transform = `scale(${scale})`;
|
|
}
|
|
|
|
let scale = 1;
|
|
const el = document.querySelector('body');
|
|
el.onwheel = zoom;
|
|
|
|
|
|
}); |