2013-08-30 49 views
0

我有一个简单的功能,可以旋转图像并正常工作。但问题是重载页面是第一个始终默认图像后,所以从头开始旋转。我想在重新加载页面之后重新加载并继续旋转之前具有相同的图像。我知道我必须使用cookies,但我不知道如何。有一些简单的方法来解决它?感谢提前。jQuery - 重新加载页面后继续旋转图像

旋转的功能:

$.fn.rotate = function() { 
    var container = $(this); 
    var totale = container.find(\"div\").size(); 
    var current = 0; 
    var i = setInterval(function() { 
     if (current >= totale) current = 0; 
     container.find(\"div\").filter(\":eq(\"+current+\")\").fadeIn(2000).end().not(\":eq(\"+current+\")\").fadeOut(2000); 
     current++; 
    }, 2000); 
    return container; 
    }; 
    })(jQuery); 

回答

相关问题