Zooming and Panning to the Image using jQuery and CSS3
Submitted by alpha_luna on Thursday, August 25, 2016 - 17:00.
We are going to create Zooming and Panning to the Image using jQuery and CSS3. This jQuery plugin is very simple to use. It allows the user to drag, pan, and zoom in/out in any elements of the web page using CSS3 and jQuery.
You can also check the live demo of this simple tutorial, so you can get an idea and you can try this out, let's start coding.
How to use it
Create Markup
Create simple HTML source code for the zooming and panning of the image functionality.
And, create HTML Element you want to apply the zooming and panning.
jQuery Script
Kindly add this simple jQuery script below your markup to fully functional.- <script>
- (function() {
- var $section = $('section').first();
- $section.find('.panzoom').panzoom({
- $zoomIn: $section.find(".zooming_In"),
- $zoomOut: $section.find(".zooming_Out"),
- $zoomRange: $section.find(".zoom-range"),
- $reset: $section.find(".reset")
- });
- })();
- </script>
Output
