How to disable google translate original text tooltips

前端 未结 5 424
南旧
南旧 2021-02-01 22:14

I have used google translate as a language converter in my site but it displays annoying tool tips called \'Original text\'. How do I disable this and any other better ideas/too

5条回答
  •  借酒劲吻你
    2021-02-01 22:38

    It appears you can hide it with some CSS on the iframe they use to do the "tool tip".

    .goog-te-balloon-frame { display: none; }
    

    It might be a moving target as they update the service and change names/structure, but it works right now on a in-progress site of mine.

    UPDATE: I've noticed a mouseover/hover background color effect that appears to linger on with this method, but it appears to be accomplished with JavaScript (added as style attributes on the element itself rather than a class toggle where you can override it easier). Tying into Google's translate JavaScript to do much of anything has proven quite difficult. Regardless, getting rid of the iframe was the most important part.

提交回复
热议问题