Download
User Rating: 5/5 ( 2 votes)
magnifyMe is a jQuery plugin that can be used to add zoom functions to product images or any other image for that matter.
Source: codepunker.com
1. INCLUDE JS FILES
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="magnifyMe.js"></script>
2. HTML
<div class="magnifyMe">
<div class="iamMagnified"></div>
</div>
3. CSS
.magnifyMe {
background: url('//path to image');
background-size: contain;
background-repeat: no-repeat;
width: Xpx;
height: Xpx;
position: relative;
overflow: hidden;
}
.iamMagnified {
width: Xpx;
height: Xpx;
position: absolute;
background: url('//path to image');
background-size: initial;
background-repeat: no-repeat;
border-radius: 100px;
box-shadow: 0 0 10px #000;
border: 4px solid #CCC;
opacity:0;
}
div.magnifyMe:hover .iamMagnified {
opacity: 1;
};
4. JAVASCRIPT
jQuery('.magnifyMe').magnifyMe('iamMagnified');