• Hi All,

    I wanted to change the tooltip of the Close button in the popup and tried several methods however none of them has given the result I wanted.

    I tried using javascript to select the button id like this:
    jQuery(document).ready(function () { $(“#fancybox-close”).attr(“title”, “Sluiten”); });
    When inspecting the dom this works until I click to open the popup. The code is then overwritten and the default “Close” tooltip appears.

    I tried changing the plugin files hardcoding the tooltip there in the jquery.fancybox.js on line 147 and even on line 161 and still no result.
    When inspecting the jquery.fancybox.js in the browser after loading the page none of my changes are there to my suprise.

    I tried these changes on all the javascript files and on the versions of fancybox but no succes.
    Can anyone help me achieve this simple request that somehow becomes a nightmare?

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @deancheukalam translating these light box texts (integrated into the light box script) is planned for a future release. Until then, you have this option:

    1. Switch the script version on Settings > Media to the “fancyBox2”
    2. Add this PHP code snippet to either your theme’s functions.php, or via a plugin like WPCode or Code Snippets or via your own custom plugin (in wp-content/mu-plugins/ for example):
    add_filter( 'easy_fancybox_fb_opts', function($opts) { $opts['txt'] = array('close'=>'Sluiten'); return $opts; } );
    Thread Starter deancheukalam

    (@deancheukalam)

    Hey Rolf,

    Thanks for this feedback.
    It has resolved the issue.

    Hoever I can’t close the fancybox popup using the close button on mobile devices.
    Is it because of this code or a known bug?
    How can I fix this?

    It only closes when I click outside of the popup at the moment.

    Hi, could you share a link to where this issue can be seen live? The URL in the original post seems to be using another light box…

    Thread Starter deancheukalam

    (@deancheukalam)

    One example of this is https://www.remyvastgoed.com/109180

    If you open the link “perceel kaart” you could see the easy fancybox in action.

    We are using fancybox v2 as you suggested. This only happens on a mobile devices (Android and IOS)

    I notice this image is also opening small, how can we get it to open to big on the mobile screen?

    Hi, I see the issue on your site. I do not think it is related to the translation but I’ll have to investigate to find out more. I’ll probably have some time next week to take a closer look…

    About the image size on mobile: Go to the Window section on Settings > Media and (1) reduce the Margin setting as much as possible and (2) maybe try un-checking the option “Scale large content down to fit in the browser viewport.”

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change to tooltip of the close button’ is closed to new replies.