Skip to content

Commit

Permalink
Add mousewheel plugin to fix demo across browsers. Close gh-28.
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Sep 5, 2013
1 parent 0d119b6 commit ea07fc2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .bowerrc
@@ -0,0 +1,3 @@
{
"directory": "bower_components"
}
1 change: 1 addition & 0 deletions bower.json
Expand Up @@ -15,6 +15,7 @@
"panzoom.js"
],
"devDependencies": {
"jquery-mousewheel": "~3.1.3",
"mocha": "~1.12.0",
"chai": "~1.7.2"
}
Expand Down
3 changes: 2 additions & 1 deletion demo/index.html
Expand Up @@ -12,6 +12,7 @@
</style>
<script src="../test/jquery.js"></script>
<script src="../dist/jquery.panzoom.js"></script>
<script src="../bower_components/jquery-mousewheel/jquery.mousewheel.js"></script>
</head>
<body>
<section>
Expand Down Expand Up @@ -371,7 +372,7 @@ <h1>Use the mousewheel to zoom on a focal point</h1>
var $panzoom = $section.find('.panzoom').panzoom();
$panzoom.parent().on('mousewheel.focal', function( e ) {
e.preventDefault();
$panzoom.panzoom('zoom', e.originalEvent.wheelDelta < 0, {
$panzoom.panzoom('zoom', (e.delta || e.originalEvent.deltaY) < 0, {
increment: 0.1,
focal: e
});
Expand Down

0 comments on commit ea07fc2

Please sign in to comment.