Hey guys, i was taking a look at saruik's theme for winterboard. and i wanted to make some changes... i want to be able to do more than 2 images but im not exactly sure how to change things to make it happen.
Code:
<?xml version="1.0" encoding="UTF-16"?>
<html><head>
<base href="Private/"/>
<!--meta name="viewport" content="width=320, minimum-scale=1.0, maximum-scale=1.0"/-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style>
body {
background-color: black;
margin: 0;
padding: 20px 0 0 0;
height: 442px;
width: 320px;
}
img {
-webkit-transition-property: opacity;
-webkit-transition-duration: 2s;
position: absolute;
width: 320px;
height: auto;
}
img.fade-out {
opacity: 0;
}
img.fade-in {
opacity: 1;
}
</style>
</head><body style="color: black">
<img id="one"/>
<img id="two"/>
<script>
var images = ['ran_and_chen_01.jpg', 'ran_and_chen_02.jpg'];
var index = 0;
var fade_in = one;
var fade_out = two;
fade_in.src = images[0];
fade_out.src = images[images.length - 1];
var fade = function () {
fade_in.src = images[index];
index = (index + 1) % images.length;
fade_in.className = 'fade-out';
fade_out.className = 'fade-in';
var fade_tmp = fade_in;
fade_in = fade_out;
fade_out = fade_tmp;
setTimeout(fade, 15000);
};
fade();
</script>
</body></html>
I was thinking to just add more to
Code:
var images = ['ran_and_chen_01.jpg', 'ran_and_chen_02.jpg', 'ran_chen_03.jpg', 'ran_chen_04.jpg'];
and so on but that does not work quite right.
I read the page at saruik's web space but it refers me to apple developer for css stuff and apple wants 100.00 to join what appears to be forums and refference material.
Any hints welcome.
here's another thing i tried and still no luck...
one image loads, and when it fades i can see another image load but instantly switch to a different one...
so its still only fading two... and flashing one by.
Code:
<?xml version="1.0" encoding="UTF-16"?>
<html><head>
<base href="Private/"/>
<!--meta name="viewport" content="width=320, minimum-scale=1.0, maximum-scale=1.0"/-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style>
body {
background-color: black;
margin: 0;
padding: 20px 0 0 0;
height: 442px;
width: 320px;
}
img {
-webkit-transition-property: opacity;
-webkit-transition-duration: 2s;
position: absolute;
width: 320px;
height: auto;
}
img.fade-out {
opacity: 0;
}
img.fade-in {
opacity: 1;
}
</style>
</head><body style="color: black">
<img id="one"/>
<img id="two"/>
<img id="three"/>
<script>
var images = ['ran_and_chen_01.jpg', 'ran_and_chen_02.jpg', 'ran_and_chen_03.jpg'];
var index = 0;
var fade_in = one;
var fade_out = two;
var fade_out = three;
fade_in.src = images[0];
fade_out.src = images[images.length - 1];
var fade = function () {
fade_in.src = images[index];
index = (index + 1) % images.length;
fade_in.className = 'fade-out';
fade_out.className = 'fade-in';
var fade_tmp = fade_in;
fade_in = fade_out;
fade_out = fade_tmp;
setTimeout(fade, 15000);
};
fade();
</script>
</body></html>