2017-05-12 155 views
1

我翻譯了谷歌翻譯的網頁。但是當我們對翻譯文本進行掃描時,文本就會消失。在Google翻譯網頁上的文字上顯示文字時,文字消失

任何人都可以告訴如何解決這個問題嗎?

http://careturtle.com/firebase/translate_test.php

<!doctype html> 
<html> 
    <head> 
     <title>Translator</title> 
     <script type="text/javascript" src="jquery.min.js"></script> 
     <script src="jquery.cookie.js"></script>  
     <style type="text/css"> 
     .goog-te-banner-frame.skiptranslate{display:none!important;} 
     body{top:0px!important;} 
     div#goog-gt-tt{display:none!important;}.goog-text-highlight{display:none!important;opacity:0;} 
     </style> 
    </head> 
    <body> 
     <script type="text/javascript"> 
     $.cookie('googtrans', '/en/hi'); 
     </script> 
     <div id="google_translate_element" style="display: none;"></div><script type="text/javascript"> 
function googleTranslateElementInit() { 
    new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); 
} 
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> 
    This is a test website. 
    </body> 
</html> 

回答

0

我已經添加了樣式爲<p>標籤,其中谷歌類被追加和隱藏的元素。那並不急劇閃爍。

希望可以幫助你

感謝

<!doctype html> 
<html> 
    <head> 
     <title>Translator</title> 
     <script type="text/javascript" src="jquery.min.js"></script> 
     <script src="jquery.cookie.js"></script>  
     <style type="text/css"> 
     .goog-te-banner-frame.skiptranslate{display:none!important;} 
     body{top:0px!important;} 
     div#goog-gt-tt{display:none!important;}.goog-text-highlight{display:none!important;opacity:0;} 
     </style> 
<style> 
p.appearnone font font{ 
     display: block !important; 
     opacity: 1 !important 
} 
</style> 
    </head> 
    <body> 
     <script type="text/javascript"> 
     $.cookie('googtrans', '/en/hi'); 
     </script> 
     <div id="google_translate_element" style="display: none;"></div><script type="text/javascript"> 
function googleTranslateElementInit() { 
    new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); 
} 
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> 
    <p class="appearnone">This is a test website. 
    </body> 
</html> 
+0

仍然相同。我想它正在消失 – Observer

+0

請檢查編輯的代碼,希望這會起作用 –

+0

它做到了,但作爲副作用,它會使光標在文本上出現時出現條狀。 – Observer