Why oh why do I need Silverlight to view other background images in Bing? Cause Tom makes me write out all the source...
<img id="paint">
<br/>
<span onclick="back()">prev</span>
<span onclick="fwd()">next</span>
<script>
var photos = [];
var index = photos.length -1;
window.onload = function() {
photos = [
"http://ncip.nssc.nasa.gov/images/Home/Moon%20Salute.jpg",
"http://farm1.static.flickr.com/144/385806153_c69fa2229b.jpg?v=0",
"http://www.wired.com/news/images/full/billyh1_f.jpg",
"http://3.bp.blogspot.com/_JdybrokZBAk/RcwA0k1O5tI/AAAAAAAAAUo/N0DPfOwEkq4/s320/DSCN0327.JPG",
"http://4.bp.blogspot.com/_p4tgkwtZjQ8/RklDPwv9oDI/AAAAAAAAAFk/oXMa5epUz3s/s320/C.Sima-Oct06+smaller+version.jpg"
];
index = 0;
show();
}
function back() {
if(index >=1) index--;
show();
}
function fwd() {
if(index < photos.length-1) index++;
show();
}
function show() {
document.getElementById('paint').src = photos[index];
}
</script>
Load the array through a remote JSON call and add a fading transition and you are good to go. |