I'm trying to create a draggable image using the jQuery plugin by Jack L Moore. However, when I attempt this, I get the following error:
TypeError: $(...).zoom is not a function
Below is the head of my website, which links to the CDN of the file. Then, in the actual body, I have the below, however presumably as it doesn't understand .zoom
the problem lies with the code within <head>
.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.1/js/all.js"></script>
<link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700,800" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-zoom/1.7.20/jquery.zoom.js"></script>
<script>
$(document).ready(function() {
$('#ex1').zoom();
$('#ex2').zoom({
on: 'grab'
});
$('#ex3').zoom({
on: 'click'
});
$('#ex4').zoom({
on: 'toggle'
});
});
</script>
</head>
<body>
<span class='zoom' id='ex1'>
<img src='IMAGE_URL' width='555' height='320' alt='Daisy on the Ohoopee'/>
<p>Hover</p>
</span>
</body>
</html>