img-zoom-js
Version:
A completely responsive image zoom library based on js
36 lines (33 loc) • 907 B
HTML
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Image Zoom Demo</title>
<style>
body {
margin: 0;
padding: 0;
}
.demo-container {
padding: 1rem;
margin: auto;
max-width: 960px;
}
.zoom-img {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="demo-container">
<img id="zoomImg" class="zoom-img" src="demo.jpg" alt="" />
</div>
</body>
<script src="img-zoom.js"></script>
<script>
ImgZoom(document.getElementById('zoomImg'));
</script>
</html>