Hi Developers , Today we are going to see jQuery Image Magnifier on Mouse Hover
For image magnifier on mouse hover we are going to use zoom.js
We are going to use zoom.js CDN
So, let's see jquery image magnifier on mouse hover, magnify images on mouse hover effect.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-zoom/1.7.21/jquery.zoom.js"></script>
<style>
body {
margin: 20px;
border: 1px solid grey;
}
.container {
display: block;
padding: 0px;
}
.contain {
position: fixed;
right: 10%;
top: 25%;
width: 200px;
height: 220px;
margin-top: 25px;
}
img {
width: 250px;
height: 250px;
margin: 20px;
}
b{
margin-left: 20px;
}
</style>
</head>
<body>
<center>
<h1>jQuery Image Magnifier On Mouse Hover - ITSolutionsGuides</h1>
</center>
<div class="container-fluid">
<b>Hover the image to see the effects</b>
<div class="parent">
<img src="">
</div>
<span class="contain"></span>
</div>
<script>
$(document).ready(function() {
$('.parent').css('width', $('img').width());
$('img').parent().zoom({
magnify: 1,
target: $('.contain').get(0)
});
});
</script>
</body>
</html>
We hope it helps everyone. Thanks for supporting ITSolutionsGuides and keep supporting us also follow us in social media platforms.
Be the first to know about releases and tutorial news and solutions.
We care about your data in our privacy policy.
ITSolutionsGuides was started mainly to provide good and quality web solutions for all the developers. We provide tutorials to support all the developers and also we try to provide solutions to the errors we face while coding.
Copyright © 2023 - 2024 All rights reserved | ITSolutionsGuides