Multiple Instances of Google Translate

后端 未结 6 2074
慢半拍i
慢半拍i 2021-02-15 18:59

I\'m trying to get multiple instances of Google Translation Drop Down to show up, but it seems it will only pick one to show up.

Full Page Code

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-15 19:39

    This is practically not achievable as Google has not built it to work with multiple instances on the page at all. After hacking with the code a little, this is the best you can achieve http://jsbin.com/hiwazedi/1/

    To get this to work how you want, you would have to download and host all the files yourself and make heavy modifications. Seeing as how all the code is obfuscated, this wouldn't be easy. It would also most likely break after a while if and when Google updates how it works on their end. Lastly this would most likely be against their terms of service.

    Another solution

    The only reason I could see you wanting to do this is to display it in the header and footer for example. If so I would either position it fixed, so that the user can see it where ever they scroll on the page. Alternatively you could detect when the user is near the bottom of the page and move it to the footer.

提交回复
热议问题