• Resolved jbd7

    (@jbd7)


    Hi,

    I have installed WPR on my theme, and was already using the Flickr-Foto-Info plugin, which displays an icon over Flickr photos linked in a post.

    That plugin works fine when WPR is not displayed. However, when WPR is on the top of my website (in “mobile mode”, for narrow viewports), the coordinates are wrongly calculated.

    I figured out that the JS code of that plugin calls show_toolbar with wrong parameters (basically, the toolbar is shown too low, with an offset equal to the height of WPR)

    $j(document).ready(function () {
        toolbar_div = $j("<div class='flickr-toolbar'></div>");
        $j('body').append(toolbar_div);
        flickr_images = $j("img[src *='flickr']");
        $j(flickr_images).each(function () {
            $j(this).hover(function () {
                img_html = $j('<div>').append($j(this).clone()).remove().html()
                matches = re.exec(img_html);
                if (matches) {
                    show_toolbar(matches[1], $j(this).offset());
                }
            }, function () {
                $j('.flickr-toolbar').hide();
            })
        })
    })

    Would you know how to make the offset function take the WPR static menu in consideration?

    Thanks

    https://wordpress.org/plugins/wp-responsive-menu/

Viewing 1 replies (of 1 total)
  • Thread Starter jbd7

    (@jbd7)

    For those interested, this is what I added in the JS of the plugin to make it consider the height of the WPR static menu:

    if (document.getElementById('wprmenu_bar').offsetHeight == null) {
        adjustment = 0;
      }
    else {
        adjustment = document.getElementById('wprmenu_bar').offsetHeight;
    }
    
    toolbar_top = parseInt(image_offset.top) + 10 - adjustment; ...
Viewing 1 replies (of 1 total)
  • The topic ‘Conflict with plugin using coordinates’ is closed to new replies.