It looks like you’re using the experimental ‘loupe’ feature. Does the reload issue still occur if you don’t use the default display instead of the loupe?
Thread Starter
ohodek
(@ohodek)
It works when I take off the loupe function but only when I access the image trough the thumbnail. If I reload the page while on it it just does a constant reload loop.
Thank You
The reload was added as a fix to prevent the metrics getting offset when the browser is resized. It should only reload once and this shouldn’t be too noticable as it should reload from the browser cache, however this may be affected by the size of the image files.
Your full size image is a PNG of 11.8MB which is a lot larger than the images I used when I developed the plugin.
Does it load any better if you swap out your image to use a jpg version reduced in size using the tinyjpg service? You should be able to get your full size image down to under 500k.
Thread Starter
ohodek
(@ohodek)
Resized the image to a 573KB JPG still does the same thing. Any other ideas? What would be an optimal image size to test this with?
The plugin works great and does what I need it too but I know my client will have a problem with the reloading.
Thank you for your quick responses.
I have not been able to reproduce the repeated reload issue on my test site, so there may be a javascript incompatibility.
The reload was added as a workaround to issues with the zoom overlay dimensions and position after the browser is resized, however in most cases this wouldn’t cause a problem.
As a workaround to the issue you have from the workaround you could remove the reload scripts by making some small edits to the featured-image-zoom.php plugin. Although it is not normally recommended to edit plugins as any changes will be lost after an upgrade, these are simple deletions that can easily be repeated.
If you are happy to do this the lines to delete are:
74-75:
jQuery(".zoom").bind("resize",function(){window.location.reload(false);});
window.onorientationchange = function (){window.location.reload(false);}
and 89:
wp_register_script( 'resize', plugin_dir_url(__FILE__) . 'js/jquery.resize.js', array('jquery'), '1.1.2', false );
Thread Starter
ohodek
(@ohodek)
That fixes the issues. Unfortunately as you said now the zoom function does not line up at all on mobile. Is there any way to edit this code instead of removing it to work?
I have no experience with php
I’ve not been able to replicate this on my test site and it looks like you are now using a different plugin, so I’ll set this to closed for now.