Tiny jQuery Image Zoom Magnifying Glass Effect Image Projection - Download Tiny jQuery Image Zoom Magnifying Glass Effect - Image Projection

Download Tiny jQuery Image Zoom Magnifying Glass Effect – Image Projection

Posted on

This time I will share jQuery Plugin and tutorial about Tiny jQuery Image Zoom Magnifying Glass Effect – Image Projection, hope it will help you in programming stack.

Tiny jQuery Image Zoom Magnifying Glass Effect Image Projection - Download Tiny jQuery Image Zoom Magnifying Glass Effect - Image Projection
File Size: 426 KB
Views Total: 6831
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A simple, lightweight, unobtrusive jQuery image zoom plugin for creating a magnifying glass effect to enlarge part of an image.

How to use it:

1. Include the jQuery javascript library and the jQuery Image Projection plugin at the end of the Html page.

1 <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
2 <script src="javascripts/image.projection.js"></script>

2. Insert an image into the Html and use data-pimg attribute to specify the larger version of the image.

1 <div class="wrap">
2   <div class="overlay"></div>
3   <img src="images/1-small.jpg" id="demo" data-pimg="images/1.jpg" />
4 </div>

3. Initialize the plugin.

1 $( window ).load(function(){
2  
3 $(".wrap .overlay").imageProjection($("#sampleimg"));
4  
5 });

4. Custom the styles of the magnifying lens and overlay via CSS as you want.

01 #ip-viewfinder{
02   border: dotted #ccc 1px;
03   background: rgba(255,255,255,0.5);
04 }
05  
06 .wrap {
07   float: left;
08   display: block;
09   position: relative;
10 }
11  
12 .overlay {
13   width: 100%;
14   height: 100%;
15   display: block;
16   position: absolute;
17   z-index: 2;
18 }
19  
20 .overlay:after {
21   content: "Hover me!";
22   position: absolute;
23   left: 50%;
24   top: 50%;
25   margin-left: -80px;
26   margin-top: -1.5em;
27   width: 160px;
28   height: 3em;
29   line-height: 3em;
30   text-align: center;
31   background: rgba(255, 255, 255, 0.5);
32   font-weight: bold;
33 }
34  
35 .overlay:hover:after { display: none; }

Change log:

v0.0.2 (2015-11-02)


This awesome jQuery plugin is developed by widatama. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net