• Resolved tmh23

    (@tmh23)


    Please help so that it disables on mobile. I do not have the ‘enable on mobile’ selected but it is still enabled. Also, when you disable the plugin it still continues to work.

    please help resolve this.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author SilkyPress

    (@diana_burduja)

    It sounds as if you’re using a caching plugin. Try to regenerate the caches.

    Thread Starter tmh23

    (@tmh23)

    Yes. I tried simply deleting the cache but it wasn’t until I deactivated the cache plugin that it solved the issue.

    Wondering if there is a way to just have the thumbnail/main image switching work on mobile without the zoom window? The switching of the thumbnail to the main image works really nice on mobile but you don’t need the zoom as you can simple pinch zoom on mobile.

    Plugin Author SilkyPress

    (@diana_burduja)

    If you disable the zoom on mobiles, then all the gallery functionality goes back to the default one.

    If you want to simulate the thumbnail/main image switching behavior, you can try adding the following JavaScript code to the website:

    jQuery(document).ready(function( $ ){
      	var exchange_thumbnails = '0';
      
          $("a[data-rel^='prettyPhoto']").each(function(index){
            $(this).click(function(event){
                // If there are more than one WooCommerce gallery, exchange the thumbnail with the closest .attachment-shop_single
                var obj1 = $(".attachment-shop_single");
                if ( obj1.length > 1 ) {
                    var obj1 = $(this).closest('.images').find( $(".attachment-shop_single") );
                }
                var obj2 = $(this).find("img");
    
                event.preventDefault();
    
                if ( obj2.hasClass('attachment-shop_single') === false ) {
    
                    // Remove the srcset and sizes
                    obj1.removeAttr('srcset').removeAttr('sizes');
                    obj2.removeAttr('srcset').removeAttr('sizes');
    
                    var thumb_src = obj2.attr('src');
    
                    // Exchange the attributes
                    $.each(['alt', 'title'], function(key,attr) {
                        var temp;
                        if ( obj1.attr( attr ) ) temp = obj1.attr( attr );
                        if ( obj2.attr( attr ) ) {
                            obj1.attr(attr, obj2.attr(attr) );
                        } else {
                            obj1.removeAttr( attr );
                        }
                        if ( exchange_thumbnails == '1' ) {
                            if ( temp && temp.length > 0 ) {
                                obj2.attr(attr, temp);
                            } else {
                                obj2.removeAttr( attr );
                            }
                        }
                    });
                  
                    // Exchange the link sources
                    var temp;
                    temp = obj2.parent().attr('href');
                    if ( exchange_thumbnails == '1' ) {
                        obj2.parent().attr('href', obj1.parent().attr('href'));
                    }
                    obj1.parent().attr('href', temp );
    
                    // Set the obj1.src = the link source
                    obj1.attr('src', temp );
    
                    // Set the obj2.src = data-thumbnail-src
                    if ( obj1.data('thumbnail-src') && exchange_thumbnails == '1' ) {
                        obj2.attr( 'src', obj1.attr('data-thumbnail-src'));
                    }
                }
            });
          });
    });
    
    Thread Starter tmh23

    (@tmh23)

    Thank you for this code… I will plug it in when I have a chance.
    I am still having the issue that the zoom is happening on mobile even when it is not selected. I have deactivated my caching plugin and it still happens. It seems there is some bug that is making it active on mobile no matter what the setting is.

    Can you please advise a fix?

    Troy

    Thread Starter tmh23

    (@tmh23)

    Oh and as for the code about… would this go in the functions.php file of my child theme?

    Plugin Author SilkyPress

    (@diana_burduja)

    You might be having a cache on another level, for example a CDN. But it’s a cache. The zoom cannot “happen”, it can be or not be shown on the mobile.

    No, you don’t add JavaScript code in a PHP file. Search the www.ads-software.com plugins for “custom JS” and install a plugin where you can put the JS.

    Can you give me the link to your website so I can have a look?

    • This reply was modified 8 years ago by SilkyPress.
    Thread Starter tmh23

    (@tmh23)

    Here is a link to the website:
    https://www.parttimefish.com

    I have the zoom enabled for desktop but not for mobile and I put the custom JS code in a plugin called ‘Custom JS’.

    I am still getting the zoom function on mobile.

    Thread Starter tmh23

    (@tmh23)

    I have to deactivate my caching plugin and reactivate it and then the mobile zoom turns off. What I would like to have is the zoom function work the way it does on desktop.. Its perfect!!… and just have the thumbnail switching on mobile with no zoom. Is this possible? This would be a fantastic setup!!

    Troy

    Plugin Author SilkyPress

    (@diana_burduja)

    The link was very helpful. There I could see you’re using the WP Super Minify plugin and could replicate the situation on my computer.

    Would you please update the zoom plugin to the 1.7 version. There I’ve written a small compatibility with the WP Super Minify plugin. You’ll also need to deactivate/activate the WP Super Minify plugin, as it seems they have a problem with deleting the cache unless you deactivate the plugin. This should remove the zoom from the mobile devices.

    Thread Starter tmh23

    (@tmh23)

    I still am having issues with this randomly activating on mobile with it disabled for mobile. What is causing this??

    Plugin Author SilkyPress

    (@diana_burduja)

    The plugin isn’t active on the https://www.parttimefish.com website. Give me the URL of the website where it is acting like this.

    Thread Starter tmh23

    (@tmh23)

    Sorry I had uninstalled and reinstalled to see if that fixed it. It is active on the site now.

    Plugin Author SilkyPress

    (@diana_burduja)

    On the desktop, when hovering over the image, I get a zoom window next to the image. On the mobile, when clicking on the image, I don’t get a zoom window, but I get a popup with the image, with left/right arrows and a black transparent background. This popup with the image is not made by the WP Image Zoom plugin. You can check this by deactivating the WP Image Zoom plugin and see if you still get this image popup.

    I don’t know if the theme adds the popup or another plugin, you’ll have to find out by yourself.

    Thread Starter tmh23

    (@tmh23)

    Yes. The pop up with arrows is standar functionally in woocommerce. What was happening was that randomly the plugin will start working on mobile. So products it was on some it wasn’t. I believe the plugin still has issuse with caching. I had to turn off my caching then uninstall the zoom plugin. After reinstalling the newly downloaded plugin (both times it was the latest version) and activating it seems now to not have the issue.

    The only reason I have it off for mobile is that the zoom window isn’t visible on mobile. There needs to be a setting so you can have the zoom window to the right on desktop and have a superset setting for the mobile zoom window to be positioned directly over the main image so it is visible on mobile.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Won’t disable on mobile!’ is closed to new replies.