本文介绍了隐藏Google翻译栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下代码:
<div style="" class="skiptranslate">
<iframe frameborder="0" style="visibility:visible"
src="javascript:''"
class="goog-te-banner-frame skiptranslate"
id=":2.container"></iframe>
</div>
我需要隐藏它,但是如果我仅使用以下方法隐藏goog-te-banner-frame:
I need to hide it but if I only hide the goog-te-banner-frame using:
.goog-te-banner-frame {
display:none !important
}
它仍然使我的标头下降.如果我使用这个:
It still throws my header down. If I use this:
.skiptranslate {
display:none !important
}
由于它共享相同的类,因此它还隐藏了语言选择下拉列表.我想隐藏包含goog-te-banner-frame的skiptranslate div.
It also hides the language selection dropdown because it shares the same class.I'd like to hide the skiptranslate div that CONTAINS the goog-te-banner-frame.
我该怎么做?
这是创建"上面的转换div的实际代码:
This is actual code to "create" the translate div above:
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE,
autoDisplay: false,
includedLanguages: ''}, 'google_translate_element');}
</script>
<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
推荐答案
好的,出于某些原因,它可以正常工作:
Ok, this works for some reason:
.goog-te-banner-frame.skiptranslate {
display: none !important;
}
body {
top: 0px !important;
}
这篇关于隐藏Google翻译栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!