An Interest In:
Web News this Week
- April 3, 2024
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
jQuery Image Magnifier on Mouse Hover
In this tutorial, We will see jQuery image magnifier on mouse hover. using an image magnifier you can enlarge the image on mouse hover. Using jquery you can image zoom on mouse hover. Also, you can jquery image zoom in zoom out on mouse click.
In this example, Users can directly zoom images in with the mouse wheel or pinch zoom on touch devices using javascript or image zoom on mouseover using jquery.
Also, you can use different types of plugins for zoom images. here I have used zoom.js CDN to zoom or magnify images. using zoom.js jQuery that enables the user to show the full-size image on hover and view details with mouse move.
So, let's see jquery image magnifier on mouse hover, magnify images on mouse hover effect.
Example :
<!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 - Techsolutionstuff</h1> </center> <div class="container-fluid"> <b>Move your Cursor Over the Image</b> <div class="parent"> <img src="https://laravelnews.imgix.net/laravel-news__logo.png?ixlib=php-3.3.1"> </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>
Read Also : How to Add and Delete Rows Dynamically using jQuery
Output :
You might also like :
Original Link: https://dev.to/techsolutionstuff/jquery-image-magnifier-on-mouse-hover-16m
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To