• Resolved TableauxAdmin

    (@tableauxadmin)


    So you can’t run any js scripts in AMP validated pages? That means any page that uses a js script to render images in a gallery will not work well, or not work at all.

    Images are a major part of our website and they were displaying fine until the last AMP update. Now the plugin has made it where all the images in my galleries are semi-transparent on mobile, I assume because because the js script cannot run. I deactivated AMP and my galleries display as expected on mobile.

    Is there a workaround for this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Custom JavaScript in the traditional sense is restricted in AMP although you can use the amp-script component. The restriction is an AMP framework principle for performance reasons.

    If you’d like to share the gallery plugin you are using I’d be happy to investigate, in particular as you mentioned it was working previously.

    The native WordPress gallery block also works in AMP.

    Thread Starter TableauxAdmin

    (@tableauxadmin)

    The plugin I am using is https://justifiedgrid.com/. I’ve been using this paid version on our sites for some time with no issues on desktop or mobile. As a matter of fact, I chose this particular plugin because it worked so well on mobile.

    Here is a screencap of the AMP results I got before disabling:
    https://tableaux.com/files/images/jig-AMP-screencap.jpg

    We use it on several galleries but here is one you can look at https://tableauxhospitality.com/lookbook/ Right now I have AMP disabled and all the images display as expected. If I activate AMP, the images display semi-transparent.

    That Justified Image Grid plugin depends on JS, it cannot be replaced with anything meaningful without JS.

    Plugin Author Weston Ruter

    (@westonruter)

    If you require that custom JS functionality on that page and there isn’t a good AMP-compatible alternative, you can just disable AMP for that one page. You can find an “AMP Enabled” toggle when you edit the page.

    Thread Starter TableauxAdmin

    (@tableauxadmin)

    OK, well that helps a little. But google won’t like those pages.

    Plugin Author Weston Ruter

    (@westonruter)

    If you want to go AMP-first, we have a newly-revamped plugin site with documentation: https://amp-wp.org/

    There is an ecosystem section that has themes and plugins which are AMP-compatible. Jetpack is not yet listed there, but it is mostly now AMP-compatible. It has some grid layouts that are similar to what you have on your site.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘JS Scripts’ is closed to new replies.