Skip to content

Commit

Permalink
Removed jQuery dependency
Browse files Browse the repository at this point in the history
Added 'wheelzoom.destroy' event for removing changes that wheelzoom has made to an element.
  • Loading branch information
jackmoore committed Oct 14, 2014
1 parent 6e4647e commit 9e0ec0f
Show file tree
Hide file tree
Showing 4 changed files with 210 additions and 178 deletions.
17 changes: 6 additions & 11 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@
<html>
<head>
<meta charset="utf-8">
<title>jQuery Wheelzoom</title>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="jquery.wheelzoom.js"></script>
<script>
$(document).ready(function(){
$('img').wheelzoom();
});
</script>
<title>Wheelzoom</title>
</head>
<body>
<img src='daisy.jpg' alt='Daisy!' width='555' height='320'/>
<br/>
<img src='daisy.jpg' alt='Daisy!'/>
<img class='zoom' src='daisy.jpg' alt='Daisy!' width='555' height='320'/>
<script src="wheelzoom.js"></script>
<script>
wheelzoom(document.querySelector('img.zoom'));
</script>
</body>
</html>
162 changes: 0 additions & 162 deletions jquery.wheelzoom.js

This file was deleted.

14 changes: 9 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# jQuery Wheelzoom
# Wheelzoom

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.
A small script for zooming IMG elements with the mousewheel/trackpad. Wheelzoom works by replacing the img element's src with a transparent image, then using the original src as a background image, which can be sized and positioned. Wheelzoom is dependency free, doesn't add any extra elements to the DOM, or change the positioning of the IMG element.

## Usage:
````javascript
$('img').wheelzoom();
wheelzoom(document.querySelectorAll('img'));
// or
$('img').wheelzoom({zoom:0.05});
wheelzoom(document.querySelectorAll('img'), {zoom:0.05});
// zoom sets the zoom percent.
````

## License
This plugin is licensed under the [MIT License](http://opensource.org/licenses/MIT)
[MIT License](http://opensource.org/licenses/MIT)

## Supported Browsers:
Chrome, Safari, Opera, FireFox 17+, IE9+.

## Changelog:

##### v.3.0.0 - 2014/10/14
* Removed jQuery dependency
* Added 'wheelzoom.destroy' event for removing changes that wheelzoom has made to an element.

##### v.2.0.1 - 2014/9/9
* Merged bugfix to wrap background-image path in quotes. Ref #8.

Expand Down
Loading

0 comments on commit 9e0ec0f

Please sign in to comment.