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

azi*_*ziu 2 html javascript css popup language-translation

我在我的网站中使用 Google Widget 进行翻译。但是当我点击翻译时,它会在 Top my Page 中弹出并在向下滚动时阻止我的菜单导航。

我尝试了一些 css、html 和 javascript,但它无法解决如何在单击时隐藏我的菜单导航中弹出的谷歌翻译?

CSS :

#google_translate_element{width:300px;float:right;text-align:right;display:block}
#goog-gt-tt {dispaly:none;visibility: hidden;}
Run Code Online (Sandbox Code Playgroud)

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>
Run Code Online (Sandbox Code Playgroud)

谢谢回答

azi*_*ziu 7

最后我通过查看 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;}
Run Code Online (Sandbox Code Playgroud)