Last active
December 2, 2023 18:55
-
-
Save softiconic/cb0255fec85885f7d45e63760d09d1f3 to your computer and use it in GitHub Desktop.
Create a slider of a specific type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="changingtext">Grass Roots Advertising</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var text = [ 'Direct Impact <span>Marketing</span>','<tt> </tt>Drive <span>Buyer</span> Traffic','Grass Roots<span> Advertising</span>','Advertising <span> That</span> Works']; | |
var counter = 0; | |
var elem =document.getElementById('changingtext'); | |
var f = setInterval(change, 1000); | |
function change() { | |
elem.innerHTML = text[counter]; | |
counter++; | |
if (counter >= text.length) { | |
counter = 0; | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment