Google API translator. How can I translate only one DIV?

后端 未结 2 1935
灰色年华
灰色年华 2021-01-27 22:29

How can I modify this code to translate the only one container on page with id #lyrics?

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-27 23:10

    Solved with this function:

    function googleSectionalElementInit() {
      new google.translate.SectionalElement({
        sectionalNodeClassName: 'lyrics',
        controlNodeClassName: 'translate-lyrics',
        background: 'trasparent'
      }, 'google_sectional_element');
    }
    

提交回复
热议问题