/
Simple banner code
Simple banner code
This is some simple code to display a div with content which changes:
function SCRATCHhello(Content){
console.log("Hello");
var D = document.querySelector(".SPLASHbanner");
D.innerHTML = Content;
}
var SCRATCHquotes=
['Iguana changed my life',
'Iguana makes work more efficient',
'I love Iguana'];
function SCRATCHquote(i){
i= i %SCRATCHquotes.length;
SCRATCHhello(SCRATCHquotes[i])
}
var SCRATCHindex=0;
setInterval(function(){
SCRATCHindex=SCRATCHindex+1;
SCRATCHquote(SCRATCHindex);
}, 3000);
How can change the interval to 5 seconds?
How can make it convenient to write longer quotes?
How could we add formatting to the quotes?
How could we style the div?
, multiple selections available,
Related content
setTimeout and setInterval - timed events
setTimeout and setInterval - timed events
Read with this
How do I change the content of a DOM element?
How do I change the content of a DOM element?
More like this
The Javascript console and Developer Tools in Chrome
The Javascript console and Developer Tools in Chrome
Read with this
How can I change variables outside of my function with my timer?
How can I change variables outside of my function with my timer?
More like this
Origins of Javascript/ECMA Script
Origins of Javascript/ECMA Script
Read with this
Source code to the progress function
Source code to the progress function
More like this