-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Responsive #16
Comments
Ok, now let assume per different screen size you have different layout for responsive output of your design. Right now there is no native options available to set this quickly. But to achieve this manual control per screen size of setting the type of zoom, we can try next JS code with xZoom API: (function ($) {
$(document).ready(function() {
function manual_responsive(xzoom) {
var width = $(window).width();
if (width < 500) {
xzoom.options.position = "fullscreen"
} else if (width < 700) {
xzoom.options.position = "bottom"
} else if(width < 960) {
xzoom.options.position = "left"
} else {
xzoom.options.position = "right"
}
}
var instance = $('.xzoom, .xzoom-gallery').xzoom({adaptive: false});
manual_responsive(instance);
$(window).resize(function() {
manual_responsive(instance);
});
});
})(jQuery); Here, I have created new function P.S. Make sure that |
Outstanding, thank you very much for your time and help, your plugin is amazing. This works and has fixed my problem, I would of never worked that out.
This is my code, I know I could of simplify the syntax for xzoom.options to an $.extend but for easy reading for anyone else new to jQuery, I hope this helps. |
If xZoom is not being used on a webpage it crashes my other Javascript and jQuery that I'm using.
This error always appears. I'm still using the same script from my previous comment. |
Sorry I fixed it, I wrapped it in an if statement.
|
No problem, thanks for sharing your solution 👍 |
I've notice it's only responsive if the preview container goes a certain width off the screen and then it'll position the the zoom inside the zoom container. How do I manually change the types of zoom at different screen sizes so I can decide which type of responsive zoom design I wish to use?
The text was updated successfully, but these errors were encountered: