• pase

    (@photoshopace)


    Is it possible to disable the image tooltip in the FTG without dropping the image title?

    When the FTG Caption options: WordPress caption field and WordPress title field are set to Don’t use captions and Don’t use title the tooltip and image title do not display.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter pase

    (@photoshopace)

    This code snippet is almost working.
    on mouseenter title attribute is hidden.
    on mouseleave title attribute restores.
    on click title attribute restores on lightbox overlay exit it fails

    When the lightbox closes it fails to restore the title attribute. Clicking a second time on the image does not restore the image title.
    What is missing in the code snippet to be able to restore the anchor title attribute when the lightbox overlay closes?

    jQuery(document).ready(function($) {

    $(‘a[title]’).on(‘mouseenter’, function () {
    var $this = $(this);
    $this.attr(‘title-cache’, $this.attr(‘title’));
    $this.attr(‘title’, ”);
    });

    $(‘a[title]’).on(‘mouseleave’, function () {
    var $this = $(this);
    $this.attr(‘title’, $this.attr(‘title-cache’));
    $this.attr(‘title-cache’, ”);
    });

    $(‘a[title]’).on(‘click’, function () {
    var $this = $(this);
    $this.attr(‘title’, $this.attr(‘title-cache’));
    $this.attr(‘title-cache’, ”);
    });

    $(‘.lightbox’).on(‘click’, function () {
    // restore anchor title attribute
    });
    });

    Hi there,

    you can do this:

    $(‘.lightbox’).on(‘click’, function () {
     $("[title-cache]").each(function () {
        $(this).attr("title", $(this).attr("title-cache"));
     });
    });
    Thread Starter pase

    (@photoshopace)

    Thanks for getting back.still unable to make it work with you code suggestion. Running the code through a js lint produces several warnings but no errors. Any other suggestions?

    `jQuery(document).ready(function($) {

    $(‘a[title]’).on(‘mouseenter’, function () {
    var $this = $(this);
    $this.attr(‘title-cache’, $this.attr(‘title’));
    $this.attr(‘title’, ”);
    });

    $(‘a[title]’).on(‘mouseleave’, function () {
    var $this = $(this);
    $this.attr(‘title’, $this.attr(‘title-cache’));
    $this.attr(‘title-cache’, ”);
    });

    $(‘a[title]’).on(‘click’, function () {
    var $this = $(this);
    $this.attr(‘title’, $this.attr(‘title-cache’));
    $this.attr(‘title-cache’, ”);
    });

    $(‘.lightbox’).on(‘click’, function () {
    $(“[title-cache]”).each(function () {
    $(this).attr(“title”, $(this).attr(“title-cache”));
    });
    });

    });

    Thread Starter pase

    (@photoshopace)

    The issue is when closing the lightbox the title attribute is not restored. Clinking on the visited image launches the lightbox without the image title. Refreshing the page restores all title attributes.

    Thread Starter pase

    (@photoshopace)

    Thanks, your solution simple, and works well. When the FTG plugin updates will the change get overwritten?

    Yes, it is possible that update of new version can replace this file for a new one and this hack would be lost. Unfortunatelly I still haven’t found better solution that works.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Image tooltip’ is closed to new replies.