I have this code:
$(function games() {
// Different timeouts for each div
var times = [4000, 5000, 5000, 8000, 8000];
var counter = 0;
divs = $('#tuk1, #tuk2, #tuk3, #tuk4, #tuk5');
function showDiv() {
// hide all divs, filter current index, and fadeIn
divs.hide().eq(counter).fadeIn(0);
// set time out duration from array of times
setTimeout(showDiv, times[counter]);
// cycle the counter
counter = (counter + 1) % divs.length;
};
showDiv(); // show first div
});
How could I modify it to save the last DIV viewed by the user on a COOKIE? I searched for a long time, I do not find, please..