Create magnifying glass zoom effect using jQuery magnify Plugin
Create magnifying glass image zoom effect using jQuery magnify Plugin
You must have seen on many shopping website, You can zoom the product image to see the clear view of design, If you are looking for same effect then here I am going to share jquery plugin to add magnifying glass style zoom functionality to images. Magnify is a simple, lightweight jQuery plugin that adds a magnifying glass style zoom functionality to images. It is a useful feature to have for product images on ecommerce websites, or if you just want people to be able to zoom into an image without spawning additional overlays or popup windows that may cover your content.
Integrate magnifying glass zoom effect on website
Follow below quick steps to integrate magnifying glass style like zoom functionality on images.
Include the magnify.css and jquery.magnify.js on along with jquery core library.
<!--CSS--> <link rel="stylesheet" href="magnify.css"> <!--JS--> <script src="//code.jquery.com/jquery-latest.min.js"></script> <script src="jquery.magnify.js"></script>
The URI to the large image can be placed in the data-magnify-src attribute as shown below, or passed as the src option when calling the .magnify() function
<img src="product.jpg" class="zoom" data-magnify-src="product-large.jpg">
If the data-magnify-src attribute or src option is not used, then Magnify will try to grab the large image from the parent <a> tag. Example:
<a href="product-large.jpg"> <img src="product.jpg" class="zoom"> </a>
NOTE: The large image needs to have the same aspect ratio as the main image.