The best place to find jQuery plugins !

Welcome on myjqueryplugins,

the best jquery plugins library !

Add your jQuery plugin.

Connect it with GitHub and create your plugin Homepage.

Make known your plugin to the community or link it to your own website !

Wheelzoom : zooming IMG elements with the mousewheel/trackpad.

Plugin rate :

jQuery Wheelzoom is a small plugin for zooming IMG elements with the mousewheel/trackpad.

Wheelzoom works by scaling and positioning a background-image, after it sets the IMG element's src to a transparent png.

Wheelzoom doesn't add any extra elements to the DOM, or change the positioning of the IMG element.

Wheelzoom doesn't change the DOM. It works by sizing and positioning background-size and background-position styles.

Wheelzoom replaces an img's background-image with it's src. Then the src is set to a transparent PNG. The benefit to using a background-image is that plugin does not change the DOM or the positioning of the img element. This means that the plugin should just work regardless of your specific CSS or markup. The drawback that there is no support for background-sizing in older browsers (IE8). The img element is left unmodified for unsupported browsers.

Implementation: 

1. FIRST, INCLUDE JQUERY FILES

1
2
3
<!-- include JS files -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="wheelzoom.jquery.js"></script>

2. ADD YOUR HTML

1
<p><img src="path_to_image" alt="Alternative Text" /></p>

3. NOW, CALL THE JRATING PLUGIN

1
2
3
4
5
6
7
8
9
10
11
12
<script type="text/javascript">
$(document).ready(function(){
  // Simple call
  $('img').wheelzoom();
 
  // or zoom sets the zoom percent.
  $('img').wheelzoom({zoom:0.05});
 
  // zooming out can be triggered by calling 'wheelzoom.reset'
  $('img').trigger('wheelzoom.reset');
});
</script>
Screenshots

Add new comment

To prevent automated spam submissions leave this field empty.

Plain text

  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <p> <br> <br />

Informations

jQuery
>= 1.7
Current version
1.1.2
Browsers compatibility
Google ChromeIE 9Mozilla FirefoxOperaSafari
Fork it on github Comments [0]