Comments (1)
That should be possible by defining custom onUpdate callbacks - something like below:
var $img1 = $('#image1');
var $img2 = $('#image2');
$img1.imgViewer({
onUpdate: function() {
var zoom2 = $img2.imgViewer("option",zoom);
if (zoom2 !== this.options.zoom)
$img2.imgViewer("option",zoom, this.options.zoom);
var view2 = $img2.imgViewer(getView);
var view = this.getView();
if (view2.left !== view.left || view2.right !== view.right || view2.top !== view.top || view2.bottom !== view.bottom )
$img2.imgViewer("panTo",(view.left+view.right)/2, (view.top+view.bottom)/2));
}
});
$img2.imgViewer({
onUpdate: function() {
var zoom1 = $img1.imgViewer("option",zoom);
if (zoom1 !== this.options.zoom)
$img1.imgViewer("option",zoom, this.options.zoom);
var view1 = $img1.imgViewer(getView);
var view = this.getView();
if (view1.left !== view.left || view1.right !== view.right || view1.top !== view.top || view1.bottom !== view.bottom )
$img1.imgViewer("panTo",(view.left+view.right)/2, (view.top+view.bottom)/2));
}
});
from imgviewer.
Related Issues (20)
- Image extends over containing div HOT 9
- pos.x real width. Not 1 HOT 4
- URGENT: Not zooming to the actual area HOT 4
- Zoom in Zoom out HOT 5
- Wanted to close Note Edit HOT 7
- Save cropped image to server? HOT 3
- Replace image src HOT 1
- Fullscreen with panning HOT 2
- Fill Viewport on zoom HOT 1
- Zoom on iphone HOT 1
- Question about saving to image HOT 1
- IE11 not returning a position HOT 2
- Panning not working, zoomin does, where should I look for the problem? HOT 4
- Mobile crosshair HOT 2
- blocked row/column of pixel HOT 3
- Not working when img src is a png extracted from blob HOT 2
- IE 11.590 HOT 1
- How to set scroll direction to increase or decrease zoom HOT 2
- JQuery is not defined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgviewer.