Comments (5)
Didn't check yet, but orientationchange event is possible to use to run some corrections with xZoom instance i guess.
from xzoom.
I'll try to replicate this later on my end here. To see what is possible to do.
from xzoom.
I didn't check will this code work or not, but you can try this one:
var instance = $('.xzoom, .xzoom-gallery').xzoom();
var isTouchSupported = 'ontouchstart' in window;
if (isTouchSupported) {
//Initial orientation value
var sco1 = 0;
$(window).bind("resize", function(){
//90 = landscape, 0 = portrait
var sco2 = ($(window).width() > $(window).height())? 90 : 0;
if(sco1 != sco2) {
sco1 = sco2;
//Close zoom because orientation just has been changed
instance.closezoom();
}
});
}
from xzoom.
I tried and tested this code, unfortunately it didn't work. No errors in my console.
from xzoom.
I was able to fix the problem using some Javascript instead of jQuery. I couldn't seem to get Jquery mobile orientationchange to work at all, it created more problems than fixed.
window.addEventListener("orientationchange", function() {
console.log('Change'); //Show the change in the console
instance.closezoom(); //close the crashed zoom container
}, false);
I added this under my touch condition section.
from xzoom.
Related Issues (20)
- Please Update this to work with JQuery v3.1 or later. HOT 2
- While i'm click the first time small preview it the there is that possible to hide this in mobile devices. HOT 3
- xZoom Lens is not adjusting in small size of image HOT 9
- xZoom lens in mobile HOT 5
- how can I make the zoom result image bigger than the container HOT 2
- rootOutput HOT 2
- Capturing current zoom scale HOT 1
- Page Not Scrolling HOT 1
- Module build failed: ModuleNotFoundError: Module not found: Error: Can't resolve '../images/xloading.gif' in 'C:\Users\fhsna\Projetos de software\lojafinal\loja\node_modules\xzoom\dist' HOT 3
- Add xzoom event on dynamic images HOT 2
- Is it possible to use it with Vue.js? HOT 10
- php laravel HOT 2
- Thumbnail image click not working HOT 1
- Lens is not working - overlapping lens frame on hover HOT 1
- Question - xzoom container size adjustability HOT 1
- i made the thumbnail in left side of the image like amazon but its throwing error in js HOT 2
- Zoom aspect ratio changes when adding image of the same size as of the demo car images HOT 2
- Either cursor is not working or Popup image window position is not right HOT 2
- Perfect plugin ,Why no arrows button HOT 1
- how can use in gulpjs file 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 xzoom.