效果如下:
 
 
TRANSLATE
<div id="google_translate_element"  style="display:none;"></div>
<div id="translate_link" style="margin-bottom:14px"/>
<a href="#"
onclick="document.getElementById('google_translate_element').style.display='inline';document.getElementById('translate_link').style.display='none';return false;">
TRANSLATE
</a>
<script type="text/javascript">
    function googleTranslateElementInit() {
        new google.translate.TranslateElement({
            pageLanguage: 'en',
            autoDisplay: false,
            gaTrack: true,
            layout: google.translate.TranslateElement.InlineLayout.SIMPLE
        }, 'google_translate_element');
    }
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" type="text/javascript"></script>

以上代码嵌入到页面body中,即可实现调用google翻译,翻译页面body内容。

注:只改变页面显示效果。

 

相关文章:

  • 2021-11-23
  • 2022-12-23
  • 2021-12-23
  • 2021-04-03
  • 2022-02-12
  • 2021-11-22
  • 2021-06-21
  • 2021-12-31
猜你喜欢
  • 2021-11-20
  • 2021-11-23
  • 2022-01-08
  • 2021-12-08
  • 2022-01-20
  • 2022-12-23
  • 2021-07-19
相关资源
相似解决方案