Prevent image Zoom in Desktop Mod by click event
See original GitHub issueHi, i have following code to select next picture on click.
gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
gallery.init();
gallery.listen('unbindEvents', function() {
gallery.framework.bind( gallery.scrollWrap, 'pswpTap', nextOnClick,true)
});
gallery.framework.bind( gallery.scrollWrap, 'pswpTap', nextOnClick );
function nextOnClick(e) {
if (e.detail.pointerType == 'mouse' && e.detail.target.className == 'pswp__img') {
if (gallery.getCurrentIndex() == gallery.items.length-1 ) {
gallery.close();
} else {
gallery.next();
}
return false;
}
}
it works, but if i set
options.showAnimationDuration = 333;
for opening animation. By clicking the image is zoomed and going to next picture.
Is it possible to unbind image zoom on click without modifying the library?
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Disable double-tap "zoom" option in browser on touch devices
Simple prevent the default behavior of click , dblclick or touchend events will disable the zoom ...
Read more >I want to disable zoom in and zoom out feature in window 10
Click Pinch Zoom from the left pane, then uncheck the Enable Pinch Zoom box. Click the Apply button, then OK. You may also...
Read more >How can i disable image zooming and remove the zoom icon ...
In your theme.liquid file, find the </body> (press CTRL + F or command ... But is there a way to prevent product zoom,...
Read more >How to disable zoom on a mobile web page using CSS?
To disable the zooming option with the multi-touch gesture we can use surefox browser but still, a user can zoom in or out...
Read more >Managing advanced screen sharing settings - Zoom Support
Sign in to the Zoom desktop client. Click your profile picture, then click Settings. Click the Share Screen share-screen-button__1_.png tab.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
… will destroy function that toggles desktop zoom. You can do the same thing with any other public function, e.g.
gallery.ui.onGlobalTap = function() { alert('tap or click'); }
.Don’t be afraid to modify default UI, it’s created as a separate file and just via public methods, so developers could edit it.
clickToCloseNonZoomable: false @dimsemenov many thanks!