mirandacreative / wl

0 stars 0 forks source link

Why are we not dropping the code inside the html instead of using Javascript? #72

Closed MikaCaldera closed 6 years ago

MikaCaldera commented 6 years ago

https://github.com/mirandacreative/wl/blob/45509cdff4fa48765959d0e2c3e84a066a2889a9/wp-content/themes/MC-genesis-boilerplate/template-parts/sticky-header.php#L7

Infn8Loop commented 6 years ago

Google's JavaScript library populates the div with by targeting the element by ID. We can't change google's script because the file doesn't live on our server, it's owned by google and lives on their server. We can't change how it works. All we can do is specify the options and call the script to create the element. Check mccoder.js for more info on that. You can see where I've specified a condition to populate one or the other div the window width is mobile or not. It's all in that JavaScript file.

Documentation: https://www.w3schools.com/howto/howto_google_translate.asp

this is all I can find on how to style it https://stackoverflow.com/questions/6633127/can-you-style-the-google-translate-plugin#6633181