I have a question. How to gradually change the class, every 60 seconds. And is it possible to connect to the Functions of the current time?
This is an example but it will not change the class every 60 seconds
Here is my code:
$(function() {
function test() {
$('#test1').switchClass('class1', 'class2', 1000);
if($('#test1').hasClass('class1'))
{
$('#test1').switchClass('class2', 'class1', 1000);
}
else
{
$('#test1').switchClass('class1', 'class2', 1000);
}
}
// run function
test();
// loop function
setInterval(function() { test();}, 1000);
});
css code:
.class1 {
width: 400px;
height: 200px;
background: lightgray;
transition: all 60s ease-out;
-webkit-transition: all 60s ease;
-moz-transition: all 60s ease;
-o-transition: all 60s ease;
}
.class2 {
width: 400px;
height: 200px;
background: orange;
transition: all 60s ease-out;
-webkit-transition: all 60s ease;
-moz-transition: all 60s ease;
-o-transition: all 60s ease;
}