toolkit icon indicating copy to clipboard operation
toolkit copied to clipboard

Changeable text in the SHARELATEX_RIGHT_FOOTER field

Open h714je opened this issue 2 years ago • 0 comments

I would like to add a changeable text in the SHARELATEX_RIGHT_FOOTER field. To do this, the easiest way is to write the simplest script in js. How can I add this script?

JS

window.onload = function() {
    var textArray = [
        'Text 1',
        'Text 2',
        'Text 3',
    ];
    var rotatingText = document.getElementById('ChangableText');
    var randomIndex = Math.floor(Math.random() * textArray.length); 
    ChangableText.innerHTML = textArray[randomIndex];
}

Maybe someone else has a more concise idea.

h714je avatar Jun 03 '23 05:06 h714je