Answer the question
In order to leave comments, you need to log in
How to load text into a block on a timer?
There is an object from which I load data and stuff them into tags. Everything would be fine, but the place in the widget is not rubber (How to change the values in the tag over time? For example, there are three h1 tags, the script from the object loads some text, it takes 2 minutes and it loads the next text from the object and deletes the old one. In case If the text is over, it goes in a circle.. I tried to implement it using a recursive function, but I haven't managed to set up a shift yet... Maybe someone has already designed this
?
var json_date = {
"dills": {
"1": {
"name": "boock_1",
"time": "15:00",
},
"2": {
"name": "book_2",
"time": "15:00",
},
"3": {
"name": "book_3",
"time": "09:00",
},
"4": {
"name": "book_4",
"time": "05:00",
}
}
}
var ix = 0;
$.each(json_date['dills'], function(key, val) {
$('li > h1').eq(ix++).text("").text(val.name);
console.log(ix);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question