Topic: Captions show over hover pictures [SOLVED]

Hello,

is you open my site www.edvervanzijnbed.nl in the first post you see the word 'ger' in red. The red words have a picture behind them which is shown when you hover your mouse over the word.

The picture of the ger (in this case) is shown, but the captions of the images in the widget on the right side (under 'Live' meekijken) show through the hover picture. I tried to change the z-index of the hover pictures to 9999 but that doesn't do the trick.

Can you help me out?

Thanks,
Edwin

Re: Captions show over hover pictures [SOLVED]

The problem might be finding the correct element(s) to apply a high enough z-index to.
However, once you find them, you might need to use a z-index value higher than 9999. (Juicebox uses z-index: 9999; for the #jb-glry-dlg container in the 'jbcore/classic/theme.css' file).
Whatever ids or classes you were setting the z-index to 9999 on, try using a higher value to see it this helps.
Otherwise, whatever plugin you are using to display your hidden images, try contacting their support and ask how to increase the z-index value. They should know which elements/classes within their script the z-index value should be applied to.

Re: Captions show over hover pictures [SOLVED]

Increasing the value didn't help, I'll try asking the support team from the Hover plugin

Re: Captions show over hover pictures [SOLVED]

I'll try asking the support team from the Hover plugin

OK. They should certainly be able to point you in the right direction.

Re: Captions show over hover pictures [SOLVED]

Hi Steven,

I asked Stefan the developer of the Hover plugin, but he says he can't help me. So I am now hoping you can come up with a solution.

Kind regards,
Edwin

Re: Captions show over hover pictures [SOLVED]

Unfortunately, your problem is quite difficult to troubleshoot.
Your hover image appears only when you hover over a link and the gallery's caption area appears only when you hover over the gallery.
In addition to this, the hover plugin you use seems to be using JavaScript to control the hover behavior (rather than just CSS) so enabling :hover in a browser's developer tools does not help.

A Juicebox gallery comprises many different elements, each of which is assigned an appropriate z-index value (so that the correct elements are always visible when they should be) so reducing the z-index value for the caption area alone might not work. (It might need to be lowered below a certain threshold value (in order to be stacked below your hover image) to a point where the caption area is no longer visible at all.)

I still think the best solution would be to increase the z-index value of your hover image. It has fewer components than a Juicebox gallery so, in theory, should be the easier of the two to change.

Unfortunately, I am not familiar with your hover plugin and the best source of help for finding out which of its CSS classes you would need to target with a high z-index value would be its author.

This is a long shot but at the end of your 'hover.js' file, try changing:

function hover_images(in_options)
{
    var elements = domLib_getElementsByTagNames(['img'], true);
    for (var i = 0; i < elements.length; i++)
    {
        var title = hover_image_map[elements[i].src];

        if (undefined != title)
        {
            elements[i].title = title;
        }
    }
}

... to:

function hover_images(in_options)
{
    var elements = domLib_getElementsByTagNames(['img'], true);
    for (var i = 0; i < elements.length; i++)
    {
        elements[i].style.zIndex = '10000';
        var title = hover_image_map[elements[i].src];

        if (undefined != title)
        {
            elements[i].title = title;
        }
    }
}

I do not know if this will work but it might be worth trying.

Re: Captions show over hover pictures [SOLVED]

Unfortunately, it didn't work. Anyway thanks a lot Steven, you're the best.

Re: Captions show over hover pictures [SOLVED]

I'm sorry to hear that didn't work.
Unfortunately, without in-depth knowledge of the hover plugin, I do not know what class or classes to apply the z-index to (and it's difficult to determine due to the element being present on the page only when hovering over a link).

Here's something else you can try.
Add the following code to the bottom of the 'wp-content/plugins/wp-juicebox/jbcore/classic/theme.css' file:

.jb-area-caption {
    z-index: 2 !important;
}

I do not know if this will work but it might be worth a try.

Otherwise, I realise that this is not an ideal solution but perhaps you could look into using a different plugin to display your images on hover, one that is still actively developed and supported. It might be worth looking into and could turn out to be an easier solution than you think.

Re: Captions show over hover pictures [SOLVED]

That did the trick Steven, thanks man. Did I already told you that you're the best?

Re: Captions show over hover pictures [SOLVED]

Just noticed, that the overlay (in this case the full screen button) still shows through. Could that be solved in the same way perhaps. (not a biggie)

Re: Captions show over hover pictures [SOLVED]

I'm glad things are moving in the right direction.
The following should hopefully work for all elements on the overlay in a default gallery (button bar, caption area, gallery title).
However, I cannot test it in your own web page setup.

/* IMAGE OVERLAY */
.jb-classifier-show-on-over {
    z-index: 2 !important;
}

Also, I cannot be sure that elements such as the button bar and gallery title will not still overlap your hover images if they are positioned 'TOP' rather than on the overlay.
If you ever position elements 'TOP' or want to try changing the z-index for individual elements, then try:

/* CAPTION AREA */
.jb-area-caption {
    z-index: 2 !important;
}

/* GALLERY TITLE */
.jb-area-large-mode-title {
    z-index: 2 !important;
}

/* BUTTON BAR */
.jb-classifier-link-wrapper.jb-classifier-detail-area.jb-classifier-layer {
    z-index: 2 !important;
}

Re: Captions show over hover pictures [SOLVED]

That also works. I'd buy you a beer if I were in the neighborhood Steven.

Re: Captions show over hover pictures [SOLVED]

That also works.

That's great to hear! Thank you for letting me know.

I'd buy you a beer if I were in the neighborhood Steven.

That's very kind of you!