x

Remove tooltip when hovering over gallery images

When hovering over a gallery image, the caption displays in semi-transparant text over the image which looks great. But then a tooltip appears by the pointer with the same text in a grey box to the side. This looks really poor and I have had clients complain about it. Is there any way using css to disable the tooltip?

image

Tags (3)
6,435 Views
Message 1 of 15
Report
14 REPLIES 14
Square

I believe that is styled by the browser, so it probably won't be found in your site's CSS. You can still override whatever the browser uses, though:

https://codepen.io/shimdim/pen/NjyNNb

6,427 Views
Message 15 of 15
Report

Many thanks for your reply Adam.

In terms of overriding the browser, would the data title for the tooltip be .galleryCaptionHover or something else?

Kind regards

Simon

6,424 Views
Message 15 of 15
Report
Square

Hey there! Adam will be back in a couple of days but I'll make sure to forward your message on to him. Thanks! 

6,421 Views
Message 15 of 15
Report

Thanks Bernadette, I look forward to getting a reply from Adam.

6,410 Views
Message 15 of 15
Report
Square

You're welcome! This past week was pretty busy but I'm sure you'll hear from him soon. Smiley Happy 

6,408 Views
Message 15 of 15
Report

Hi Bernadette - it's been a month now and I've heard nothing - please could you or Adam reply with an answer?

Many thanks

Simon

6,372 Views
Message 15 of 15
Report
Square

Can you provide the URL of a page that has a gallery on it, @simondrydesign? I think it would help our Community members to see a live gallery.

6,371 Views
Message 15 of 15
Report

Yes of course Adam, please see https://www.southmedburn.co.uk/facilities.html

6,370 Views
Message 15 of 15
Report

Something like this will do it:

<style>
    .w-fancybox:hover {
        position: relative !important;
    }

    .w-fancybox[title]:hover:after {
         content: attr(title) !important;
         padding: 4px 8px !important;
         position: absolute !important;
         left: 0 !important;
         top: 100% !important;
         white-space: nowrap !important;
         z-index: 20 !important;
         background:red !important;
    }
</style>

That just makes it have a red background, so I'd edit that or add other style rules to make it look how you want.

6,368 Views
Message 15 of 15
Report

Hi BJ

Many thanks, but I tried adding that code and it caused the caption to stop showing altogether!

I already have some fancybox css (see below) in this theme which I suspect is conflicting with your code.

.fancybox-skin {
background: transparent !important;
box-shadow: none !important;
}

.fancybox-title {
.caption-style;
padding: 10px;
font-weight: normal;
line-height: normal;
text-align: center;
background-color: #fff;
}

.fancybox-close,
.fancybox-next span,
.fancybox-prev span {
background: none !important;
width: auto;
height: auto;
text-decoration: none;
}

.fancybox-close:before,
.fancybox-next span:before,
.fancybox-prev span:before {
color: #ffffff !important;
font-size: 50px;
font-weight: normal;
line-height: 0.5em;
.transition(all 300ms ease);
}

.fancybox-close:hover:before,
.fancybox-next:hover span:before,
.fancybox-prev:hover span:before {
color: #b9b9b9 !important;
}

.fancybox-prev span:before {
content: '\3008';
}

.fancybox-next span:before {
content: '\3009';
}

.fancybox-close {
top: 20px;
right: 20px;
}

.fancybox-close:before {
content: '\00D7';
}

Any ideas how that could be tweaked to remove the tooltip?

Kind regards

Simon

3,196 Views
Message 15 of 15
Report

The answer has been found!

Go to Settings > SEO > Footer Code and add

<script>
var imgTitle = document.querySelectorAll('.galleryInnerImageHolder a');

for( var i = 0; i < imgTitle.length; i++){
imgTitle[i].removeAttribute('title');
}
</script>

Save then publish. It works!

3,110 Views
Message 15 of 15
Report
Square

Thanks for sharing, @sinmondrydesign!

3,109 Views
Message 15 of 15
Report

Hi Adam/Bernadette

Are any of you Weebly guys going to get back to me on this issue? It's been a while now and I need to be able to solve this please!

Many thanks

Simon

3,191 Views
Message 15 of 15
Report

I don't see anything immediately obvious that should conflict so it could just be a problem with my code. You might need to talk with a web developer with this one, or try a place like stackoverflow.com.

3,190 Views
Message 16 of 15
Report