我有这段代码:
$(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
});
如何修改它以保存用户在COOKIE上查看的最后一个DIV? 我搜索了很久,我找不到,请..
答案 0 :(得分:0)
function cssLayout() {
document.getElementById("tuk").href = this.value;
}
function setCookie(){
var date = new Date("Februari 10, 2013");
var dateString = date.toGMTString();
var cookieString = "Css=document.getElementById("tuk").href" + dateString;
document.cookie = cookieString;
}
function getCookie(){
alert(document.cookie);
}

喜欢那个?