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…


This content originally appeared on DEV Community and was authored by Techsolutionstuff

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 :

jquery_image_magnifier_on_mouse_hover_output

You might also like :


This content originally appeared on DEV Community and was authored by Techsolutionstuff


Print Share Comment Cite Upload Translate Updates
APA

Techsolutionstuff | Sciencx (2022-04-01T02:52:16+00:00) jQuery Image Magnifier on Mouse Hover. Retrieved from https://www.scien.cx/2022/04/01/jquery-image-magnifier-on-mouse-hover/

MLA
" » jQuery Image Magnifier on Mouse Hover." Techsolutionstuff | Sciencx - Friday April 1, 2022, https://www.scien.cx/2022/04/01/jquery-image-magnifier-on-mouse-hover/
HARVARD
Techsolutionstuff | Sciencx Friday April 1, 2022 » jQuery Image Magnifier on Mouse Hover., viewed ,<https://www.scien.cx/2022/04/01/jquery-image-magnifier-on-mouse-hover/>
VANCOUVER
Techsolutionstuff | Sciencx - » jQuery Image Magnifier on Mouse Hover. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/04/01/jquery-image-magnifier-on-mouse-hover/
CHICAGO
" » jQuery Image Magnifier on Mouse Hover." Techsolutionstuff | Sciencx - Accessed . https://www.scien.cx/2022/04/01/jquery-image-magnifier-on-mouse-hover/
IEEE
" » jQuery Image Magnifier on Mouse Hover." Techsolutionstuff | Sciencx [Online]. Available: https://www.scien.cx/2022/04/01/jquery-image-magnifier-on-mouse-hover/. [Accessed: ]
rf:citation
» jQuery Image Magnifier on Mouse Hover | Techsolutionstuff | Sciencx | https://www.scien.cx/2022/04/01/jquery-image-magnifier-on-mouse-hover/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.