1 (edited by behladesign 2013-02-09 18:15:42)

Topic: Code Conflict

I wanted to share a fix in the coding that I found. With regards to the JuiceBox issue, I looked at the plugin and I saw that the viewport declaration was hardcoded in the code. I changed the code and tested Juicebox. It works. Problem fixed (until I upgrade the plugin!). This was related to an issue where the galleries were not displaying properly. It was forcing the site to a certain screen size which on mobile would result in the page rending only the top corner in the viewport and the user wasn't able to scale it either.

With my declaration the entire page is visible on load and it scalable.

I edited the function include_tags() in wp-juicebox.php.

Original:

function include_tags() {
        echo '<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />';
    }

Update:

function include_tags() {
        echo '<meta name="viewport" content="user-scalable = yes">';
    }

Re: Code Conflict

This <meta> 'viewport' tag will be removed in the next version of WP-Juicebox so you will not need to modify the code each time you upgrade the plugin.

Re: Code Conflict

Thanks for this update. Do you know when the next update will be released?

Re: Code Conflict

No, sorry. I do not know when the next version of WP-Juicebox will be released.
However, if you have already made this modification to the current version, you will not need to do it again (as it will be incorporated in the next version).

Re: Code Conflict

This <meta> 'viewport' tag has been removed in the latest version of WP-Juicebox (v1.2.0.1) which can now be downloaded from this web page.