• Resolved supernaut510

    (@supernaut510)


    I have added standard WordPress galleries to each marker’s infowindow, on an embedded Google Map. I installed the Easy Fancybox plugin for users to be able to view the galleries. In Chrome, the image links contain (class=”fancybox image” rel=”gallery”) in addition to the href, and the lightbox works. In Firefox, the links contain only the href (no classes and no rel) and the lightbox does NOT work, even if you add the class & rel attributes manually, in the Inspector tool. There are no errors in the console. If anyone else has seen this, or can help point me in the right direction, it would be much appreciated. Thanks.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi, are you logged into WordPress in Chrome while in Firefox you are not logged into WordPress? Try Chrome while logged out (in an anonymous browser window for example) to see if the issue is the same there…

    Also check if the browser developer console (F12) log shows any script errors and make sure all the fancybox related scripts are present in the page source code (near the end) with Ctrl+U.

    Thread Starter supernaut510

    (@supernaut510)

    Well, you might be barking up the right tree regarding logged in vs. not logged in users. Right now a new problem has been introduced, but I think the fancybox behavior is the same as before. In the logged-in browser, I currently see the lightbox loading but then I get an error in the fancybox window (“The requested content cannot be loaded. No image found.”) and in the console (https://myurl.localhost/gallery 404 (Not Found)). Not sure why it’s suddenly linking to “/gallery?” I tried uninstalling and re-installing the plugin, and deleting and re-creating the gallery, but I get the same result with the broken link… But at least the fancybox window is appearing.

    Anyway, in the incognito browser, I see exactly the same number of references to “fancybox” in the source code, and the same JS/CSS scripts being loaded in Inspector, but the lightbox does NOT appear. Instead, it simply redirects to the image URL.

    So I’ll continue working on the “/gallery/” link issue, but in the meantime my original question about why it’s not working in other browsers does seem to be related to whether I’m logged in or not. What can I do to get it working for non-logged in users?

    Thanks for the help.

    OK, so all the related fancybox script is present in the source whether you are logged in or not. Then it must be something else that is preventing the script from running. Usually this happens when another script, running before the fancybox script, triggers a fatal error. You can check script errors in the browser developer toolbar console when logged out (it may be helpful to compare it to log messages when logged in).

    About the link target: the href might be altered dynamically on page load or on click by another script. Compare the href in the page source code to the href visible in the element inspector tool, also after clicking the link (with fancybox enabled and working, so the page does not refresh) … How are you embedding these maps? Is that a plugin?

    Thread Starter supernaut510

    (@supernaut510)

    The missing image error has magically cleared up, so never mind that…every now and then I catch a break. ??

    As I continue experimenting, I’m finding that the lightbox will work in Chrome whether you are logged in, logged out, or in an incognito browser (although to be honest, it’s been a bit sporadic). But I don’t think I have ever seen it work properly in Firefox, Safari, or Edge. Wondering if it’s some Google magic, since it’s all happening with a Google Map, and only works in Google Chrome. Not sure where to go from here. Thoughts?

    Thread Starter supernaut510

    (@supernaut510)

    The galleries were created in a standard WYSIWYG editor (an ACF field). The map is manually created & embedded, based on ACF inputs–there has been a lot of customization to the map, but there are no errors in the console in either Chrome or Firefox–although FF sometimes warns that “An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.” Linting my map script at JSHint says only “Functions declared within loops referencing an outer scoped variable may lead to confusing semantics.”

    Otherwise, the only difference I have detected (as mentioned above) is there are no “class” or “rel” attributes added to the image links in Firefox.

    Thread Starter supernaut510

    (@supernaut510)

    The map loads with one infowindow already open. The gallery in that infowindow is the one that’s working in Chrome. But the other infowindows, which open on click, don’t work properly — those galleries simply link to the individual image file, as I’m seeing in other browsers. So maybe it has to do with the way the infowindows are created and pushed to the map (standard Google script…). Maybe the infowindows are not available / not ‘seen’ when the plugin is looking for them?

    Indeed, it sounds like these infowindows are created dynamically and if this happens after the “document ready” event, then FancyBox will not be aware of them nor any media links within them. The difference between Chrome and Firefox may in fact be that in Chrome the first infowindow is created just in time for FancyBox to detect it while in Firefox this happens just after…

    To make FancyBox “rescan” page content for (new) media links, you could call jQuery(document).trigger('post-load') but in your case it sounds like these infowindows each are created after a click on the corresponding map point. Do you know if the map script triggers an event after having created a new infowindow?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Google Maps / Firefox’ is closed to new replies.