如何使用 HTML CSS 禁用弹出 Google 翻译

How To Disable Pop Up Google Translation With HTML CSS

我在我的网站上使用 Google 小部件进行翻译。但是当我点击翻译时,它会在我的页面顶部弹出并在向下滚动时阻止我的菜单导航。

我尝试了一些 css、html 和 javascript,但无法修复 如何在单击菜单导航时隐藏 google 翻译弹出窗口?

CSS :

#google_translate_element{width:300px;float:right;text-align:right;display:block}
#goog-gt-tt {dispaly:none;visibility: hidden;}

HTML 和 JavaScript :

<div class="google_translate_element" id="google_translate_element"></div><div 
id="goog-gt-tt" 
class="goog-tooltip skiptranslate"  ></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'id', includedLanguages: 'af,ar,de,en,eo,es,et,fa,fr,id,it,ja,jv,ka,kn,la,mn,ms,ne,nl,pa,ru,so,sr,su,ta,th,tl,tr,uk,vi,zh-CN,zh-TW', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

感谢回答

最后我通过查看 Inspect Element 找到了它。把这些都隐藏起来

#google_translate_element{width:300px;float:right;text-align:right;display:block}
.goog-te-banner-frame.skiptranslate { display: none !important;} 
body { top: 0px !important; }
#goog-gt-tt{display: none !important; top: 0px !important; } 
.goog-tooltip skiptranslate{display: none !important; top: 0px !important; } 
.activity-root { display: hide !important;} 
.status-message { display: hide !important;}
.started-activity-container { display: hide !important;}

使用以下 URL,从您要翻译的网站将 . 更改为 -,并使用您希望的语言代码(例如:en 用于英语):

https://url_here.translate.goog/?_x_tr_sl=from_lang&_x_tr_tl=to_lang

例如,如果您想将网站 whosebug.com 从英语翻译成加泰罗尼亚语,您可以使用 URL:

https://Whosebug-com.translate.goog/?_x_tr_sl=en&_x_tr_tl=ca