Commit f82317de authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

cache images

parent cc2abc6d
...@@ -61,6 +61,7 @@ function parseURL(){ ...@@ -61,6 +61,7 @@ function parseURL(){
var index = 0; var index = 0;
var interval; var interval;
var imgs = []; var imgs = [];
var images = [];
$(function(){ $(function(){
init(); init();
...@@ -72,8 +73,12 @@ function init(){ ...@@ -72,8 +73,12 @@ function init(){
for (var i=0;i<SETTINGS.n;i++){ for (var i=0;i<SETTINGS.n;i++){
imgs.push(SETTINGS.path+"-0"+(SETTINGS.order[i])+"-"+SETTINGS.sufx); imgs.push(SETTINGS.path+"-0"+(SETTINGS.order[i])+"-"+SETTINGS.sufx);
images[i] = new Image();
images[i].src = imgs[i];
} }
//load images
index = SETTINGS.order[0]; index = SETTINGS.order[0];
init_rotator(document.getElementById('rotator')); init_rotator(document.getElementById('rotator'));
...@@ -127,7 +132,8 @@ function set_p(){ ...@@ -127,7 +132,8 @@ function set_p(){
} }
function seti(i,src){ function seti(i,src){
rotator.src = imgs[i]; //rotator.src = imgs[i];
rotator.src = images[i].src;
if (src!="radio"){ if (src!="radio"){
$("#flist-"+i).click(); $("#flist-"+i).click();
}else{ }else{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment