Skip to content

Instantly share code, notes, and snippets.

@spacehunter
spacehunter / README.md
Last active April 20, 2020 14:09
SCRIPT-8
@spacehunter
spacehunter / README.md
Created April 5, 2020 18:19 — forked from thykka/README.md
SCRIPT-8
@spacehunter
spacehunter / README.md
Last active April 5, 2020 18:12
SCRIPT-8
@spacehunter
spacehunter / LanguagePosition
Created February 10, 2013 05:26
Typically an English sentence translated to Spanish has more words for the translation. Therefore text may not align properly on a web page for a particular language. The function below will position the element based on language selection.
/* Use Case
<div class="bullet"
data-0="margin-top:-475px;margin-left:?es?(-425px, -525px);transform-origin:50% 50%;">
<span data-lang="Gane <b>Ingreso Mensual de Energía</b> (MEI)">Earn <b>Monthly Energy Income</b> (MEI)</span>
</div>
*/
var val,
elementIndex,
elements = document.getElementsByTagName('*'),